X Tutup
Skip to content

Commit 0e0563c

Browse files
committed
Add Text=str. Make ItemsView derive from AbstractSet, not Set (which is the concrete set).
1 parent bd5b9a0 commit 0e0563c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Lib/typing.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
'no_type_check',
6666
'no_type_check_decorator',
6767
'overload',
68+
'Text',
6869
]
6970

7071
# The pseudo-submodules 're' and 'io' are part of the public
@@ -1519,7 +1520,7 @@ class KeysView(MappingView[KT], AbstractSet[KT],
15191520

15201521

15211522
class ItemsView(MappingView[Tuple[KT, VT_co]],
1522-
Set[Tuple[KT, VT_co]],
1523+
AbstractSet[Tuple[KT, VT_co]],
15231524
Generic[KT, VT_co],
15241525
extra=collections_abc.ItemsView):
15251526
pass
@@ -1592,6 +1593,10 @@ def NamedTuple(typename, fields):
15921593
return cls
15931594

15941595

1596+
# Python-version-specific alias (Python 2: unicode; Python 3: str)
1597+
Text = str
1598+
1599+
15951600
class IO(Generic[AnyStr]):
15961601
"""Generic base class for TextIO and BinaryIO.
15971602

0 commit comments

Comments
 (0)
X Tutup