mirror of
https://github.com/python/cpython.git
synced 2025-11-20 02:50:14 +00:00
bpo-33217: Raise TypeError for non-Enum lookups in Enums (GH-6651)
* bpo-33217: Raise TypeError for non-Enum lookups in Enums
This commit is contained in:
parent
51a4743d19
commit
9430652535
4 changed files with 62 additions and 5 deletions
|
|
@ -976,7 +976,7 @@ Enum Classes
|
|||
The :class:`EnumMeta` metaclass is responsible for providing the
|
||||
:meth:`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that
|
||||
allow one to do things with an :class:`Enum` class that fail on a typical
|
||||
class, such as `list(Color)` or `some_var in Color`. :class:`EnumMeta` is
|
||||
class, such as `list(Color)` or `some_enum_var in Color`. :class:`EnumMeta` is
|
||||
responsible for ensuring that various other methods on the final :class:`Enum`
|
||||
class are correct (such as :meth:`__new__`, :meth:`__getnewargs__`,
|
||||
:meth:`__str__` and :meth:`__repr__`).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue