diff options
author | Guido van Rossum <guido@python.org> | 2016-10-08 20:27:55 -0700 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2016-10-08 20:27:55 -0700 |
commit | 518599b24ce015910a364152692d60733c40f88f (patch) | |
tree | c62d128eedc6787d786afe9f8aeddbba1f5141fe /Lib/typing.py | |
parent | 35e27db0075b1fdcf05d994718031a2bb92fc9c8 (diff) | |
parent | e259267e52fb14571ae3845d3d93985ad96425b9 (diff) | |
download | cpython-git-518599b24ce015910a364152692d60733c40f88f.tar.gz |
Merge further typing.py changes from upstream. (merge 3.5->3.6)
Diffstat (limited to 'Lib/typing.py')
-rw-r--r-- | Lib/typing.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/typing.py b/Lib/typing.py index 05b65b70c6..557fa589ea 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -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 |