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
Now that flask 2.0.0 has a py.typed file, the flask types are preferred over the typeshed hints. When running mypy on my code, I now see errors like the following:
app.py:6: error: Module 'flask' does not explicitly export attribute 'Flask'; implicit reexport disabled
app.py:6: error: Module 'flask' does not explicitly export attribute 'render_template'; implicit reexport disabled
app.py:6: error: Module 'flask' does not explicitly export attribute 'request'; implicit reexport disabled
app.py:6: error: Module 'flask' does not explicitly export attribute 'flash'; implicit reexport disabled
app.py:6: error: Module 'flask' does not explicitly export attribute 'send_file'; implicit reexport disabled
However, mypy expects that these reexports should either have an __all__ to explicitly say which variables are being reexported, or to change the import to from .app import Flask as Flask
Now that flask 2.0.0 has a
py.typed
file, the flask types are preferred over the typeshed hints. When running mypy on my code, I now see errors like the following:In
flask/__init__.py
there are lines like this:flask/src/flask/__init__.py
Line 7 in d575de5
However, mypy expects that these reexports should either have an
__all__
to explicitly say which variables are being reexported, or to change the import tofrom .app import Flask as Flask
In typeshed there is an example of how this was done before flask including typing: https://github.com/python/typeshed/blob/6bb1d885c696914e5900329c3d0b6bf2bfefee81/stubs/Flask/flask/__init__.pyi
Environment:
The text was updated successfully, but these errors were encountered: