-
Is your feature request related to a problemWe use mypy with the option The solution you would likeAdd a Describe alternatives you've consideredDirect imports from the respective submodules is a workaround but all examples assume an import from the main package Additional contexthttps://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-no-implicit-reexport |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
|
I've created a small PR to fix this issue. Could you test it aswell @hmvp ? |
Beta Was this translation helpful? Give feedback.
-
|
#1537 fixes my issue! |
Beta Was this translation helpful? Give feedback.
-
|
Thats good. I'm still working out some of the starlette reexports. Are you using any of the |
Beta Was this translation helpful? Give feedback.
-
|
Yeah currently we use direct imports from the place where they are defined (because mypy complains otheriwise). I don't think there is anything wrong with that, but since the docs mostly use examples that import from main, I think |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the discussion here everyone! I added support for It is available in FastAPI 0.63.0 🎉 |
Beta Was this translation helpful? Give feedback.
-
|
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues. |
Beta Was this translation helpful? Give feedback.
Thanks for the discussion here everyone!
I added support for
mypy --strictin #2547 with a lot of type annotation improvements. That should solve this use case.It is available in FastAPI 0.63.0 🎉