[Python-checkins] cpython (3.5): Add Text=str. Make ItemsView derive from AbstractSet, not Set (which is the

guido.van.rossum python-checkins at python.org
Tue Apr 5 17:57:14 EDT 2016


https://hg.python.org/cpython/rev/2577a3684f90
changeset:   100855:2577a3684f90
branch:      3.5
parent:      100853:be3c4151d9bf
user:        Guido van Rossum <guido at python.org>
date:        Tue Apr 05 14:54:25 2016 -0700
summary:
  Add Text=str. Make ItemsView derive from AbstractSet, not Set (which is the concrete set).

files:
  Lib/typing.py |  7 ++++++-
  1 files changed, 6 insertions(+), 1 deletions(-)


diff --git a/Lib/typing.py b/Lib/typing.py
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -65,6 +65,7 @@
     '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 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 @@
     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.
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list