-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix interaction between typing_extensions and collections.abc #503
Conversation
Installed typing from your repository: Unfortunately, the error still persists for me:
|
@jabdoa2 I don't think that command actually installed |
That pip command should do the same as calling setup.py manually. I can try setup.py tomorrow to be sure. |
I think that command does not install |
Makes sense. Will give it a try |
Works fine. Thanks for the fix! |
@gvanrossum If you don't have objections for this, then I will merge this PR soon. |
Go ahead! I didn't try to follow all the details but I agree with the high level idea, and the OP is happy with it. |
Fixes #501
The idea is straightforward: special classes in
typing_extensions
that have__extra__
should use a metaclass that fixes the problem inGenericMeta.__subclasscheck__
on older versions oftyping
.Note that overriding
__subclasscheck__
tries to mimic the behaviour in the new versions oftyping
. (I can't just usesuper().__subclasscheck__
on unaffected versions, since this changes call stack depth and therefore breaks asys._getframe
hack on some other versions oftyping
.)@jabdoa2 Could you please check that this fixes the crash you found in dropbox/pyannotate#36