Kaydet (Commit) 72783056 authored tarafından Guido van Rossum's avatar Guido van Rossum

Merge typing.py 3.5->3.6 (Text, ItemsView).

...@@ -65,6 +65,7 @@ __all__ = [ ...@@ -65,6 +65,7 @@ __all__ = [
'no_type_check', 'no_type_check',
'no_type_check_decorator', 'no_type_check_decorator',
'overload', 'overload',
'Text',
] ]
# The pseudo-submodules 're' and 'io' are part of the public # The pseudo-submodules 're' and 'io' are part of the public
...@@ -1519,7 +1520,7 @@ class KeysView(MappingView[KT], AbstractSet[KT], ...@@ -1519,7 +1520,7 @@ class KeysView(MappingView[KT], AbstractSet[KT],
class ItemsView(MappingView[Tuple[KT, VT_co]], class ItemsView(MappingView[Tuple[KT, VT_co]],
Set[Tuple[KT, VT_co]], AbstractSet[Tuple[KT, VT_co]],
Generic[KT, VT_co], Generic[KT, VT_co],
extra=collections_abc.ItemsView): extra=collections_abc.ItemsView):
pass pass
...@@ -1592,6 +1593,10 @@ def NamedTuple(typename, fields): ...@@ -1592,6 +1593,10 @@ def NamedTuple(typename, fields):
return cls return cls
# Python-version-specific alias (Python 2: unicode; Python 3: str)
Text = str
class IO(Generic[AnyStr]): class IO(Generic[AnyStr]):
"""Generic base class for TextIO and BinaryIO. """Generic base class for TextIO and BinaryIO.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment