bpo-41781: Fix typo in internal function name in typing (GH-23957)

This commit is contained in:
Ross 2020-12-29 11:55:28 +00:00 committed by GitHub
parent 40c2c83899
commit c1af128f5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -1249,7 +1249,7 @@ def _no_init(self, *args, **kwargs):
raise TypeError('Protocols cannot be instantiated') raise TypeError('Protocols cannot be instantiated')
def _allow_reckless_class_cheks(): def _allow_reckless_class_checks():
"""Allow instance and class checks for special stdlib modules. """Allow instance and class checks for special stdlib modules.
The abc and functools modules indiscriminately call isinstance() and The abc and functools modules indiscriminately call isinstance() and
@ -1338,12 +1338,12 @@ class Protocol(Generic, metaclass=_ProtocolMeta):
# First, perform various sanity checks. # First, perform various sanity checks.
if not getattr(cls, '_is_runtime_protocol', False): if not getattr(cls, '_is_runtime_protocol', False):
if _allow_reckless_class_cheks(): if _allow_reckless_class_checks():
return NotImplemented return NotImplemented
raise TypeError("Instance and class checks can only be used with" raise TypeError("Instance and class checks can only be used with"
" @runtime_checkable protocols") " @runtime_checkable protocols")
if not _is_callable_members_only(cls): if not _is_callable_members_only(cls):
if _allow_reckless_class_cheks(): if _allow_reckless_class_checks():
return NotImplemented return NotImplemented
raise TypeError("Protocols with non-method members" raise TypeError("Protocols with non-method members"
" don't support issubclass()") " don't support issubclass()")