Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
Closed
Labels
3.13bugs and security fixesbugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
On python 3.10-3.12, the following snippet prints True, while on Python 3.13.0 it prints False:
fromenumimportEnumfromfunctoolsimportpartialdefa(): passdefb(): passclassMyCallables(Enum): A=aB=partial(b) print(MyCallables.BinMyCallables)This is because MyCallables.B is considered to be functools.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 from this 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
Linked PRs
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error