Skip to content
Merged
Changes from 1 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
Prev Previous commit
Tweak enum section language per feedback from Ethan
  • Loading branch information
CAM-Gerlach committed Oct 17, 2022
commit 9d2486e072c406b09184e23064295a55b8ea5b40
4 changes: 3 additions & 1 deletion Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ enum

* Added :class:`~enum.ReprEnum`,
which only modifies the :meth:`~object.__repr__` of members
while returning their literal values (rather than keys)
while returning their literal values (rather than names)
for :meth:`~object.__str__` and :meth:`~object.__format__`
(used by :func:`str`, :func:`format` and :term:`f-string`\s).

Expand Down Expand Up @@ -674,6 +674,8 @@ enum

* Enhanced :class:`~enum.Flag` to support
:func:`len`, iteration and :keyword:`in`/:keyword:`not in` on its members.
For example, the following now works:
``len(AFlag(3)) == 2 and list(AFlag(3)) == (AFlag.ONE, AFlag.TWO)``

* Changed :class:`~enum.Enum` and :class:`~enum.Flag`
so that members are now defined
Expand Down