diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-02-08 22:01:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-08 22:01:38 (GMT) |
commit | 7d2f88edf0365c2d9b872dc7847b9a77a5df8aac (patch) | |
tree | 07cb06d725b22dce5f29005e463414b99673dad7 /Python/Python-tokenize.c | |
parent | dc01c84ed066ec19704f018d3925dc2fe812a2a8 (diff) | |
download | cpython-7d2f88edf0365c2d9b872dc7847b9a77a5df8aac.zip cpython-7d2f88edf0365c2d9b872dc7847b9a77a5df8aac.tar.gz cpython-7d2f88edf0365c2d9b872dc7847b9a77a5df8aac.tar.bz2 |
[3.12] gh-114071: [Enum] update docs and code for tuples/subclasses (GH-114871) (GH-114993)
Update documentation with `__new__` and `__init__` entries.
Support use of `auto()` in tuple subclasses on member assignment lines. Previously, auto() was only supported on the member definition line either solo or as part of a tuple:
RED = auto()
BLUE = auto(), 'azul'
However, since Python itself supports using tuple subclasses where tuples are expected, e.g.:
from collections import namedtuple
T = namedtuple('T', 'first second third')
def test(one, two, three):
print(one, two, three)
test(*T(4, 5, 6))
GH- 4 5 6
it made sense to also support tuple subclasses in enum definitions.
(cherry picked from commit ff7588b729a2a414ea189a2012904da3fbd1401c)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Diffstat (limited to 'Python/Python-tokenize.c')
0 files changed, 0 insertions, 0 deletions