Skip to content

Commit 0e95bbf

Browse files
authored
bpo-41521, typing: Rename _PROTO_WHITELIST to _PROTO_ALLOWLIST (#21825)
1 parent 0dfee33 commit 0e95bbf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/typing.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ def _allow_reckless_class_cheks():
10211021
return True
10221022

10231023

1024-
_PROTO_WHITELIST = {
1024+
_PROTO_ALLOWLIST = {
10251025
'collections.abc': [
10261026
'Callable', 'Awaitable', 'Iterable', 'Iterator', 'AsyncIterable',
10271027
'Hashable', 'Sized', 'Container', 'Collection', 'Reversible',
@@ -1140,8 +1140,8 @@ def _proto_hook(other):
11401140
# ... otherwise check consistency of bases, and prohibit instantiation.
11411141
for base in cls.__bases__:
11421142
if not (base in (object, Generic) or
1143-
base.__module__ in _PROTO_WHITELIST and
1144-
base.__name__ in _PROTO_WHITELIST[base.__module__] or
1143+
base.__module__ in _PROTO_ALLOWLIST and
1144+
base.__name__ in _PROTO_ALLOWLIST[base.__module__] or
11451145
issubclass(base, Generic) and base._is_protocol):
11461146
raise TypeError('Protocols can only inherit from other'
11471147
' protocols, got %r' % base)

0 commit comments

Comments
 (0)