Add _field_defaults field to typing.NamedTuple (#2362)

This commit is contained in:
EFanZh
2018-08-08 01:01:40 +08:00
committed by Jelle Zijlstra
parent 5a1ea5efb2
commit dddca3b167

View File

@@ -542,6 +542,7 @@ def cast(tp: Type[_T], obj: Any) -> _T: ...
# NamedTuple is special-cased in the type checker
class NamedTuple(tuple):
_field_types = ... # type: collections.OrderedDict[str, Type[Any]]
_field_defaults: Dict[str, Any] = ...
_fields = ... # type: Tuple[str, ...]
_source = ... # type: str