Skip to content

Commit e4dad5a

Browse files
committed
Make KT and VT private
1 parent 6b450a5 commit e4dad5a

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

typing_extensions/CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ unneeded for supporting Python 3.7 and newer.
1010

1111
- PEP_560
1212
- GenericMeta
13+
- KT
1314
- T
1415
- T_co
1516
- T_contra
17+
- VT
1618

1719
# Release 4.0.1 (November 30, 2021)
1820

typing_extensions/src/typing_extensions.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,6 @@
7878
Deque = typing.Deque
7979
DefaultDict = typing.DefaultDict
8080

81-
# Some unconstrained type variables. These are used by the container types.
82-
# (These are not for export.)
83-
KT = typing.TypeVar('KT') # Key type.
84-
VT = typing.TypeVar('VT') # Value type.
85-
8681

8782
class _ReprForm(typing._SpecialForm, _root=True):
8883
def __repr__(self):
@@ -176,7 +171,11 @@ def __getitem__(self, parameters):
176171
OrderedDict = typing.OrderedDict
177172
# 3.7.0-3.7.2
178173
else:
179-
OrderedDict = typing._alias(collections.OrderedDict, (KT, VT))
174+
# Some unconstrained type variables.
175+
# (These are not for export.)
176+
_KT = typing.TypeVar('_KT') # Key type.
177+
_VT = typing.TypeVar('_VT') # Value type.
178+
OrderedDict = typing._alias(collections.OrderedDict, (_KT, _VT))
180179

181180
_PROTO_WHITELIST = ['Callable', 'Awaitable',
182181
'Iterable', 'Iterator', 'AsyncIterable', 'AsyncIterator',

0 commit comments

Comments
 (0)