mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
[3.14] gh-118342: [Enum] update docs (GH-137290) (GH-142953)
gh-118342: [Enum] update docs (GH-137290)
(cherry picked from commit e79c39101a)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
This commit is contained in:
parent
f1288d353f
commit
e48fb94d8c
1 changed files with 3 additions and 2 deletions
|
|
@ -947,12 +947,13 @@ Utilities and Decorators
|
|||
the member's name. Care must be taken if mixing *auto()* with manually
|
||||
specified values.
|
||||
|
||||
*auto* instances are only resolved when at the top level of an assignment:
|
||||
*auto* instances are only resolved when at the top level of an assignment, either by
|
||||
itself or as part of a tuple:
|
||||
|
||||
* ``FIRST = auto()`` will work (auto() is replaced with ``1``);
|
||||
* ``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` is
|
||||
used to create the ``SECOND`` enum member;
|
||||
* ``THREE = [auto(), -3]`` will *not* work (``<auto instance>, -3`` is used to
|
||||
* ``THREE = [auto(), -3]`` will *not* work (``[<auto instance>, -3]`` is used to
|
||||
create the ``THREE`` enum member)
|
||||
|
||||
.. versionchanged:: 3.11.1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue