Closed
Description
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:
import sys
@sys.meta_path.append
class LostFinder:
@staticmethod
def find_spec(*args, **kws):
return None
and the error:
$ mypy foo.py
foo.py:4: error: Argument 1 to "append" of "list" has incompatible type "Type[LostFinder]"; expected "MetaPathFinder"
and the contents of sys.meta_path
on a vanilla Python:
$ python3.7 -I -c "import sys; print(sys.meta_path)"
[<class '_frozen_importlib.BuiltinImporter'>, <class '_frozen_importlib.FrozenImporter'>, <class '_frozen_importlib_external.PathFinder'>]
Metadata
Metadata
Assignees
Labels
No labels