Fix interaction between typing_extensions and collections.abc (#503)
Fixes #501
The idea is straightforward: special classes in typing_extensions
that have __extra__ should use a metaclass that fixes the problem in
GenericMeta.__subclasscheck__ on older versions of typing.
Note that overriding __subclasscheck__ tries to mimic the behaviour
in the new versions of typing. (I can't just use super().__subclasscheck__
on unaffected versions, since this changes call stack depth and therefore
breaks a sys._getframe hack on some other versions of typing.)
3 files changed