In python3.10, this prints True. In python3.11 it errors with:
Traceback (most recent call last):
File "/home/gary/partialmethod.py", line 23, in <module>
c.set_alive()
TypeError: Wrapper.set_state_wrap() missing 1 required positional argument: 'state'
The arguments passed to Wrapper.set_state_wrap are: python3.10: wrapper, cell, True python3.11: cell, True
So partialmethod is forgetting that set_state_wrap is a method of wrapper, and it needs to pass that in as the first arg.
I know that the way that they are using partialmethod here is not how it is intended to be used, and feels wrong. However this change is behavior if intended should be documented.
Your environment
CPython versions tested on: Python 3.11.0 (broken) Python 3.10.7 (working)
Operating system and architecture: Fedora Linux 36
The text was updated successfully, but these errors were encountered:
garyvdm commentedNov 6, 2022
Bug report
The behavior of
partialmethod
changed in python3.11. This caused a library that I use testsuite to fail.Here is a minimal use case that demonstrates this:
In python3.10, this prints
True
. In python3.11 it errors with:The arguments passed to
Wrapper.set_state_wrap
are:python3.10:
wrapper, cell, True
python3.11:
cell, True
So
partialmethod
is forgetting thatset_state_wrap
is a method ofwrapper
, and it needs to pass that in as the first arg.I know that the way that they are using
partialmethod
here is not how it is intended to be used, and feels wrong. However this change is behavior if intended should be documented.Your environment
The text was updated successfully, but these errors were encountered: