]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add Text=str. Make ItemsView derive from AbstractSet, not Set (which is the concrete...
authorGuido van Rossum <guido@python.org>
Tue, 5 Apr 2016 21:54:25 +0000 (14:54 -0700)
committerGuido van Rossum <guido@python.org>
Tue, 5 Apr 2016 21:54:25 +0000 (14:54 -0700)
Lib/typing.py

index de2a462e75948216fccbc27375433cf2ca087bfc..6ead3c41946dc5191d155f73c2ffad3a4d46ea71 100644 (file)
@@ -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.