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

gh-100458: Clarify Enum.__format__() change of mixed-in types in the whatsnew/3.11.rst#100387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethanfurman merged 7 commits intopython:mainfromanze3db:main
May 1, 2023
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Address PR feedback
  • Loading branch information
@anze3db
anze3db committedMar 22, 2023
commitbee67cab2483c1d528cec97e30cea41afaa64eb4
6 changes: 3 additions & 3 deletionsDoc/whatsnew/3.11.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -676,10 +676,10 @@ enum
* Changed :meth:`Enum.__format__() <enum.Enum.__format__>`
(the default for :func:`format`, :meth:`str.format` and :term:`f-string`\s)
of enums with mixed-in types (e.g. :class:`int`, :class:`str`)
toinclude the class name and memberkey in the output,not the member's value.
toshow the class name and membername in the output,instead of the member's value.
This matches the existing behavior of :meth:`enum.Enum.__str__`,
returning e.g. ``'AnEnum.MEMBER'`` for an enum ``AnEnum(str, Enum)``
instead of the member's value.Those wishing to keep the old formatting behavior
returning e.g. ``'AnEnum.MEMBER'`` for an enum ``AnEnum(str, Enum)``.
Those wishing to keep the old formatting behavior
may wish to modify their enums with mixed-in types to inherit from the appropriate
:class:`StrEnum` or :class:`IntEnum` class.

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp