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
We already have basic static analysis with flake8 (and the underlying pyflakes), but using typing annotations and a static typechecker may 1) find more bugs, 2) help our users by providing completion and other smart features in their IDE.
mypy is the historical typechecker, pyright is a more recent one which in my (very limited) experience works better (it's also the tool behind the new Python mode of VSCode). So I'd suggest pyright if we don't have arguments to choose mypy.
For now, neither tool can typecheck the project without error, so a first step would be to add the necessary annotations to get an error-free pyright check.
The text was updated successfully, but these errors were encountered:
moy
added
the
easy?
Probably easy to implement, or WIP almost complete
label
Feb 9, 2022
Great suggestion! I'm 100% on board with adding type annotations. I'll let this sit for a while in case anyone wants to use this as a way to get involved with MechanicalSoup, but if there are no takers for a while (a month? a year?) then I'd be happy to add them myself.
@gophra Thanks for offering to get involved! As far as I understand, type annotations can be added incrementally, so I think getting some infrastructure for testing the type annotations would be important. I see a lot of unofficial GitHub Actions for both pyright and mypy, so it'd be really useful to get something like that set up.
Alternatively, if you aren't comfortable working with GitHub Actions, starting to typehint a few functions would still be a great start. How you contribute is totally up to you!
We already have basic static analysis with flake8 (and the underlying pyflakes), but using typing annotations and a static typechecker may 1) find more bugs, 2) help our users by providing completion and other smart features in their IDE.
mypy is the historical typechecker, pyright is a more recent one which in my (very limited) experience works better (it's also the tool behind the new Python mode of VSCode). So I'd suggest pyright if we don't have arguments to choose mypy.
For now, neither tool can typecheck the project without error, so a first step would be to add the necessary annotations to get an error-free pyright check.
The text was updated successfully, but these errors were encountered: