Fix NamedTuple._field_types for python > 3.9 (#6728)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
Andrew
2021-12-29 19:58:42 +03:00
committed by GitHub
parent a89e5bb0cf
commit ff6d084995

View File

@@ -682,7 +682,10 @@ def cast(typ: object, val: Any) -> Any: ...
# Type constructors
class NamedTuple(Tuple[Any, ...]):
_field_types: collections.OrderedDict[str, Type[Any]]
if sys.version_info < (3, 8):
_field_types: 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