aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
authorAlex Waygood <Alex.Waygood@Gmail.com>2023-06-14 13:38:49 +0100
committerGitHub <noreply@github.com>2023-06-14 13:38:49 +0100
commitad56340b665c5d8ac1f318964f71697bba41acb7 (patch)
tree85e07e09edb9ae29c96bcd4fcdf01b5378765f60 /Python/bytecodes.c
parentfc8037d84c5f886849a05ec993dd0f79a356d372 (diff)
downloadcpython-ad56340b665c5d8ac1f318964f71697bba41acb7.tar.gz
cpython-ad56340b665c5d8ac1f318964f71697bba41acb7.zip
gh-105566: Deprecate unusual ways of creating `typing.NamedTuple` classes (#105609)
Deprecate creating a typing.NamedTuple class using keyword arguments to denote the fields (`NT = NamedTuple("NT", x=int, y=str)`). This will be disallowed in Python 3.15. Use the class-based syntax or the functional syntax instead. Two methods of creating `NamedTuple` classes with 0 fields using the functional syntax are also deprecated, and will be disallowed in Python 3.15: `NT = NamedTuple("NT")` and `NT = NamedTuple("NT", None)`. To create a `NamedTuple` class with 0 fields, either use `class NT(NamedTuple): pass` or `NT = NamedTuple("NT", [])`.
Diffstat (limited to 'Python/bytecodes.c')
0 files changed, 0 insertions, 0 deletions