Skip to content

Commit

Permalink
bpo-41521, typing: Rename _PROTO_WHITELIST to _PROTO_ALLOWLIST (#21825)
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner authored Aug 12, 2020
1 parent 0dfee33 commit 0e95bbf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ def _allow_reckless_class_cheks():
return True


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

0 comments on commit 0e95bbf

Please sign in to comment.