summaryrefslogtreecommitdiffstats
path: root/Python/getargs.c
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2024-02-04 15:22:55 (GMT)
committerGitHub <noreply@github.com>2024-02-04 15:22:55 (GMT)
commitff7588b729a2a414ea189a2012904da3fbd1401c (patch)
treecb5bcbe6dabb0c9458dc28491dd4172b65cf60e0 /Python/getargs.c
parentec69e1d0ddc9906e0fb755a5234aeabdc96450ab (diff)
downloadcpython-ff7588b729a2a414ea189a2012904da3fbd1401c.zip
cpython-ff7588b729a2a414ea189a2012904da3fbd1401c.tar.gz
cpython-ff7588b729a2a414ea189a2012904da3fbd1401c.tar.bz2
gh-114071: [Enum] update docs and code for tuples/subclasses (GH-114871)
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)) # 4 5 6 it made sense to also support tuple subclasses in enum definitions.
Diffstat (limited to 'Python/getargs.c')
0 files changed, 0 insertions, 0 deletions