Skip to content

Latest commit

 

History

History
8 lines (7 loc) · 494 Bytes

2023-06-09-20-34-23.gh-issue-105566.YxlGg1.rst

File metadata and controls

8 lines (7 loc) · 494 Bytes

Deprecate creating a :class:`typing.NamedTuple` class using keyword arguments to denote the fields (NT = NamedTuple("NT", x=int, y=str)). Use the class-based syntax or the functional syntax instead.

Two methods of creating NamedTuples with 0 fields using the functional syntax are also deprecated: NT = NamedTuple("NT") and NT = NamedTuple("NT", None). To create a NamedTuple class with 0 fields, either use class NT(NamedTuple): ... or NT = NamedTuple("NT", []).