summaryrefslogtreecommitdiffstats
path: root/Lib/typing.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-08-12 08:53:12 (GMT)
committerGitHub <noreply@github.com>2020-08-12 08:53:12 (GMT)
commit0e95bbf08571e98f4b688524efc2dcf20d315d91 (patch)
treeb3d5dfca66cf07bc159bddec972758f5e07798bd /Lib/typing.py
parent0dfee33dfe6b4683016dc920ee934d3a2d7323a1 (diff)
downloadcpython-0e95bbf08571e98f4b688524efc2dcf20d315d91.zip
cpython-0e95bbf08571e98f4b688524efc2dcf20d315d91.tar.gz
cpython-0e95bbf08571e98f4b688524efc2dcf20d315d91.tar.bz2
bpo-41521, typing: Rename _PROTO_WHITELIST to _PROTO_ALLOWLIST (#21825)
Diffstat (limited to 'Lib/typing.py')
-rw-r--r--Lib/typing.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/typing.py b/Lib/typing.py
index 5da032b..fce8da4 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -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',
@@ -1140,8 +1140,8 @@ class Protocol(Generic, metaclass=_ProtocolMeta):
# ... 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)