-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Spec for sys.meta_path too strict #2468
Comments
I've just hit this as well, here. Is there a workaround until it's fixed? |
I believe #5349 fixed this already, and mypy just uses an old version of typeshed. |
Is there any progress on this? I'm reviewing whether to do anything to add type annotations to |
It looks like |
Actually, I was looking at the wrong place (at |
Sorry, I can't. My comment that I mentioned above seems to have been lost somehow. I guess it'll have to wait until I get the motivation to try to apply types again, and I encounter the issue once more... |
Yes, that sounds like a proper fix. Thank you! |
In this comment, we learned that typeshed is too constrained on its spec for
sys.meta_path
, expecting instances of MetaPathFinder, whereas the existing values are ofType[MetaPathFinder]
, but more importantly, the objects there need not be instances of any particular class, but must conform to a protocol (having a.find_spec()
or.find_module()
on Python 3 and having a.find_module()
on Python 2).The text was updated successfully, but these errors were encountered: