]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-118342: [Enum] update docs (GH-137290) (GH-142954)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 18 Dec 2025 19:19:00 +0000 (20:19 +0100)
committerGitHub <noreply@github.com>
Thu, 18 Dec 2025 19:19:00 +0000 (11:19 -0800)
gh-118342: [Enum] update docs (GH-137290)

(cherry picked from commit e79c39101a9f55882f54df0bb3ecfa23238692de)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Doc/library/enum.rst

index faf8f88934ac5434ed662eacd683835575267fc4..f559659ab6056ddfbc2ba1de1fd2bfed3ec88073 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