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
I often see people making packages, type checking them with mypy, and forgetting to include a py.typed file.
Pitch
Can we add a new option to mypy to error if someone has a package without a py.typed file? It would be nice if mypy could catch this common type of error (forgetting a py.typed file).
The text was updated successfully, but these errors were encountered:
Unfortunately I don't think we can do this. If type checkers could tell if a package is missing a py.typed file, the file would not need to exist in the first place. The file exists to signal that a package should be used as a source of type information.
It is entirely reasonable to start using types internally in a package but not want them to be used externally.
As a stop-gap solution, you can use --follow-untyped-imports (recently merged, unreleased) for when a package is published without py.typed.
Feature
I often see people making packages, type checking them with
mypy
, and forgetting to include apy.typed
file.Pitch
Can we add a new option to
mypy
to error if someone has a package without apy.typed
file? It would be nice ifmypy
could catch this common type of error (forgetting apy.typed
file).The text was updated successfully, but these errors were encountered: