Closed
Description
The typeshed definition for yaml/__init__.pyi
contains the following (src):
from yaml.error import *
This has two side effects: it adds every symbol foo
in yaml/error.py
as yaml.foo
. However, it also defines yaml.error
.
I believe this is why the mypy complains about the following correct code:
import yaml
def foo():
# type: () -> None
yaml.error
$ mypy --py2 foo.py
foo.py:5: error: Module has no attribute "error"
Oddly, I can't reproduce this on Python 3. The following code does not produce a type error:
import yaml
def foo() -> None:
yaml.error
Metadata
Metadata
Assignees
Labels
No labels