Closed pavoljuhas closed 2 weeks ago
Description of the issue
Clients importing from cirq fail strict type checking as follows:
$ mypy --strict -c "from cirq import Circuit" <string>:1: error: Module "cirq" does not explicitly export attribute "Circuit" [attr-defined]
This is because our typecheck setup in mypy.ini does not enforce no_implicit_reexport.
Solution
no_implicit_reexport = true
__init__.py
from foo import bar
from foo import bar as bar
Cirq version
1.4.1 at f56a799c4dff188df9cb91c2de524a7953938e48
Description of the issue
Clients importing from cirq fail strict type checking as follows:
This is because our typecheck setup in mypy.ini does not enforce no_implicit_reexport.
Solution
no_implicit_reexport = true
to mypy.ini__init__.py
files to reexport symbols, ie, replacefrom foo import bar
withfrom foo import bar as bar
Cirq version
1.4.1 at f56a799c4dff188df9cb91c2de524a7953938e48