]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-118342: [Enum] update docs (GH-137290)
authorEthan Furman <ethan@stoneleaf.us>
Thu, 18 Dec 2025 18:31:37 +0000 (10:31 -0800)
committerGitHub <noreply@github.com>
Thu, 18 Dec 2025 18:31:37 +0000 (18:31 +0000)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Doc/library/enum.rst

index a8a7e671aadca243db25d3e2e4b5fe3833003275..0da27ba8e782847743be015a73b58b3bceb54dfb 100644 (file)
@@ -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