Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.1k
Closed
Description
Bug report
Bug description:
On python 3.10-3.12, the following snippet printsTrue, while on Python 3.13.0 it printsFalse:
fromenumimportEnumfromfunctoolsimportpartialdefa():passdefb():passclassMyCallables(Enum):A=aB=partial(b)print(MyCallables.BinMyCallables)
This is becauseMyCallables.B is considered to befunctools.partial(<function b at 0x756d7f0065c0>) on 3.13.0, when it used to be<MyCallables.B: functools.partial(<function b at 0x71f7cbc407c0>)> before.
This is something I've been using to allow function values in enums not to be considered methods, which I most likely got fromthis thread. In the example above,A would always be considered a method.
It seems like on 3.13.0, the "wrapper class" approach is the only one that works.
CPython versions tested on:
3.10, 3.11, 3.12, 3.13
Operating systems tested on:
Linux, Windows