8000 [3.11] gh-103479: [Enum] require __new__ to be considered a data type (GH-103495) by ethanfurman · Pull Request #103514 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.11] gh-103479: [Enum] require __new__ to be considered a data type (GH-103495) #103514

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 13, 2023
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
Next Next commit
remove mention of dataclass
  • Loading branch information
ethanfurman committed Apr 13, 2023
commit 102b7f8ac6defe7c16d6f438922ced74cf3a7bd1
3 changes: 1 addition & 2 deletions Doc/howto/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,7 @@ Some rules:
4. When another data type is mixed in, the :attr:`value` attribute is *not the
same* as the enum member itself, although it is equivalent and will compare
equal.
5. A ``data type`` is a mixin that defines :meth:`__new__`, or a
:class:`~dataclasses.dataclass`
5. A ``data type`` is a mixin that defines :meth:`__new__`.
6. %-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's
:meth:`__str__` and :meth:`__repr__` respectively; other codes (such as
``%i`` or ``%h`` for IntEnum) treat the enum member as its mixed-in type.
Expand Down
0