Improve NamedTuple stubs (#10220)

This commit is contained in:
Alex Waygood
2023-05-25 16:37:52 +01:00
committed by GitHub
parent 4190dbca10
commit bb701b09db
2 changed files with 14 additions and 11 deletions

View File

@@ -276,12 +276,12 @@ else:
class NamedTuple(tuple[Any, ...]):
if sys.version_info < (3, 8):
_field_types: collections.OrderedDict[str, type]
_field_types: ClassVar[collections.OrderedDict[str, type]]
elif sys.version_info < (3, 9):
_field_types: dict[str, type]
_field_defaults: dict[str, Any]
_fields: tuple[str, ...]
_source: str
_field_types: ClassVar[dict[str, type]]
_field_defaults: ClassVar[dict[str, Any]]
_fields: ClassVar[tuple[str, ...]]
__orig_bases__: ClassVar[tuple[Any, ...]]
@overload
def __init__(self, typename: str, fields: Iterable[tuple[str, Any]] = ...) -> None: ...
@overload