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
I'm not sure if this is a bug in Python or in mypy, or there is no bug at all. It seems a bit weird given the contents of sys.meta_path and my grep-fu must suck because I can't find where the signature is defined. Here's the code:
Perhaps it's a bug in typeshed... and the spec should be more lenient, to allow for MetaPathFinder or Type[MetaPathFinder] or maybe any other class that duck types a MetaPathFinder (because even the stdlib <class '_frozen_importlib.BuiltinImporter'> is not an instance of MetaPathFinder.
Activity
msullivan commentedon Sep 8, 2018
The type of
sys.meta_pathis defined in the typeshed stub: https://github.com/python/typeshed/blob/master/stdlib/3/sys.pyi#L42The class is defined here: https://github.com/python/typeshed/blob/master/stdlib/3/importlib/abc.pyi#L55
Subclassing from it should fix the error.
I don't think there is any bug here?
msullivan commentedon Sep 8, 2018
(Feel free to reopen if you disagree)
jaraco commentedon Sep 8, 2018
Perhaps it's a bug in typeshed... and the spec should be more lenient, to allow for
MetaPathFinderorType[MetaPathFinder]or maybe any other class that duck types a MetaPathFinder (because even the stdlib<class '_frozen_importlib.BuiltinImporter'>is not an instance of MetaPathFinder.msullivan commentedon Sep 8, 2018
Oh, indeed, I missed that it contained classes and not the objects.
Type[MetaPathFinder]ilevkivskyi commentedon Sep 8, 2018
Yes it is a typeshed bug, not mypy bug. @msullivan's suggestion should fix it in typeshed.
Ignore python/mypy#5589