summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido van Rossum <guido@dropbox.com>2016-04-05 14:57:03 -0700
committerGuido van Rossum <guido@dropbox.com>2016-04-05 14:57:03 -0700
commit72783056983f216104087b6c49d85ea273bf67c4 (patch)
treebef3931bdae36dab2c7c59afdfdf28233e6d658a
parent6a2dc1bd031d8b88fb80eeccb11a0f3225a3d0fd (diff)
parent0e0563ca2c6d67126f33ea077ddea19af71f14eb (diff)
downloadcpython-git-72783056983f216104087b6c49d85ea273bf67c4.tar.gz
Merge typing.py 3.5->3.6 (Text, ItemsView).
-rw-r--r--Lib/typing.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/typing.py b/Lib/typing.py
index de2a462e75..6ead3c4194 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -65,6 +65,7 @@ __all__ = [
'no_type_check',
'no_type_check_decorator',
'overload',
+ 'Text',
]
# The pseudo-submodules 're' and 'io' are part of the public
@@ -1519,7 +1520,7 @@ class KeysView(MappingView[KT], AbstractSet[KT],
class ItemsView(MappingView[Tuple[KT, VT_co]],
- Set[Tuple[KT, VT_co]],
+ AbstractSet[Tuple[KT, VT_co]],
Generic[KT, VT_co],
extra=collections_abc.ItemsView):
pass
@@ -1592,6 +1593,10 @@ def NamedTuple(typename, fields):
return cls
+# Python-version-specific alias (Python 2: unicode; Python 3: str)
+Text = str
+
+
class IO(Generic[AnyStr]):
"""Generic base class for TextIO and BinaryIO.