Skip to content

Commit 5f10495

Browse files
committedDec 29, 2024··
Deploying to gh-pages from @ f3042a1 🚀
1 parent 487d428 commit 5f10495

File tree

556 files changed

+1085
-1072
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

556 files changed

+1085
-1072
lines changed
 

‎_sources/c-api/object.rst.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ Object Protocol
111111
.. note::
112112
113113
Exceptions that occur when this calls :meth:`~object.__getattr__` and
114-
:meth:`~object.__getattribute__` methods are silently ignored.
114+
:meth:`~object.__getattribute__` methods aren't propagated,
115+
but instead given to :func:`sys.unraisablehook`.
115116
For proper error handling, use :c:func:`PyObject_HasAttrWithError`,
116117
:c:func:`PyObject_GetOptionalAttr` or :c:func:`PyObject_GetAttr` instead.
117118

‎_sources/library/enum.rst.txt

+27-2
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ Module Contents
110110
``KEEP`` which allows for more fine-grained control over how invalid values
111111
are dealt with in an enumeration.
112112

113+
:class:`EnumDict`
114+
115+
A subclass of :class:`dict` for use when subclassing :class:`EnumType`.
116+
113117
:class:`auto`
114118

115119
Instances are replaced with an appropriate value for Enum members.
@@ -152,6 +156,7 @@ Module Contents
152156

153157
.. versionadded:: 3.6 ``Flag``, ``IntFlag``, ``auto``
154158
.. versionadded:: 3.11 ``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, ``member``, ``nonmember``, ``global_enum``, ``show_flag_values``
159+
.. versionadded:: 3.13 ``EnumDict``
155160

156161
---------------
157162

@@ -821,7 +826,27 @@ Data Types
821826
>>> KeepFlag(2**2 + 2**4)
822827
<KeepFlag.BLUE|16: 20>
823828

824-
.. versionadded:: 3.11
829+
.. versionadded:: 3.11
830+
831+
.. class:: EnumDict
832+
833+
*EnumDict* is a subclass of :class:`dict` that is used as the namespace
834+
for defining enum classes (see :ref:`prepare`).
835+
It is exposed to allow subclasses of :class:`EnumType` with advanced
836+
behavior like having multiple values per member.
837+
It should be called with the name of the enum class being created, otherwise
838+
private names and internal classes will not be handled correctly.
839+
840+
Note that only the :class:`~collections.abc.MutableMapping` interface
841+
(:meth:`~object.__setitem__` and :meth:`~dict.update`) is overridden.
842+
It may be possible to bypass the checks using other :class:`!dict`
843+
operations like :meth:`|= <object.__ior__>`.
844+
845+
.. attribute:: EnumDict.member_names
846+
847+
A list of member names.
848+
849+
.. versionadded:: 3.13
825850

826851
---------------
827852

@@ -966,7 +991,6 @@ Utilities and Decorators
966991
Should only be used when the enum members are exported
967992
to the module global namespace (see :class:`re.RegexFlag` for an example).
968993

969-
970994
.. versionadded:: 3.11
971995

972996
.. function:: show_flag_values(value)
@@ -975,6 +999,7 @@ Utilities and Decorators
975999

9761000
.. versionadded:: 3.11
9771001

1002+
9781003
---------------
9791004

9801005
Notes

0 commit comments

Comments
 (0)