You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 of Type[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).
Actually, I was looking at the wrong place (at importlib.abc.MetaPathFinder), and that hasn't changed. Can you explain what problem is it that you are experiencing?
Activity
pfmoore commentedon Nov 19, 2021
I've just hit this as well, here. Is there a workaround until it's fixed?
layday commentedon Nov 19, 2021
#6344
Akuli commentedon Nov 19, 2021
I believe #5349 fixed this already, and mypy just uses an old version of typeshed.
pfmoore commentedon Nov 19, 2021
Nope, see my review comment on #6344. The current code doesn't allow for class or static methods.
pfmoore commentedon Apr 9, 2022
Is there any progress on this? I'm reviewing whether to do anything to add type annotations to
editables, and this is a blocker for me.layday commentedon Apr 9, 2022
It looks like
find_moduleandinvalidate_cacheswere re-introduced in the typeshed at some point.layday commentedon Apr 9, 2022
Actually, I was looking at the wrong place (at
importlib.abc.MetaPathFinder), and that hasn't changed. Can you explain what problem is it that you are experiencing?pfmoore commentedon Apr 9, 2022
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...
abravalheri commentedon May 11, 2024
@jaraco would #11890 be enough to address this issue? (it does not handle 2.7, or
find_moduleas it is deprecated).jaraco commentedon May 11, 2024
Yes, that sounds like a proper fix. Thank you!