Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Using functools.partial to make functions not considered as methods when given as enum values no longer works #125316

Closed
Labels
3.13bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@bluthej

Description

@bluthej

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

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp