mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Merge further typing.py changes from upstream.
This commit is contained in:
parent
7b2aa2e87c
commit
e259267e52
2 changed files with 83 additions and 1 deletions
|
@ -993,7 +993,10 @@ class GenericMeta(TypingMeta, abc.ABCMeta):
|
|||
# This allows unparameterized generic collections to be used
|
||||
# with issubclass() and isinstance() in the same way as their
|
||||
# collections.abc counterparts (e.g., isinstance([], Iterable)).
|
||||
self.__subclasshook__ = _make_subclasshook(self)
|
||||
if ('__subclasshook__' not in namespace and extra # allow overriding
|
||||
or hasattr(self.__subclasshook__, '__name__') and
|
||||
self.__subclasshook__.__name__ == '__extrahook__'):
|
||||
self.__subclasshook__ = _make_subclasshook(self)
|
||||
if isinstance(extra, abc.ABCMeta):
|
||||
self._abc_registry = extra._abc_registry
|
||||
return self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue