-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strict mypy
typing
#428
Comments
Have you looked into Pyright? I think there are a lot of reasons to consider it over MyPy for open-source libraries hoping to enforce strict typing. It's by far the most compliant with the Python typing spec, and already has support for 3.12-3.13 features through typing extensions. |
I hadn't considrered it, I'm not especially familiar with Pyright. Given that it checks all untyped code by default it does make sense to equate it to I see most projects that I contribute to using |
I'd say in most cases it's going to be stricter, one difference is that Pyright technically doesn't require you annotate all return paths. While it's probably a good idea for MyPy users (you can enforce this through Ruff's ANN rule-set instead), it has similar inference capabilities to TypeScript. This can especially be helpful with untyped/partially typed libraries you're bringing in though. MyPy just assumes |
Which project are you requesting an enhancement for?
kr8s
What do you need?
Continuing on from #381 it might be fun to get
mypy --strict
passing. This is by no means necessary but it might makekr8s
even more pleasant to use for folks who like strong type annotations and help shake out some bugs.It's unclear whether
--strict
should be added to the precommit hooks as strict typing may increase the barrier to contributing too much.The text was updated successfully, but these errors were encountered: