-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
PEP484 type hints / mypy #1456
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This |
python/typing#310 (comment) looks useful too |
PyAnnotate sounds interesting - though someone™ would need to add Python 3 style annotation support to it. |
MonkeyType seems awesome! |
mypy now supports PEP 571, which means it'd be possible to release type hints for PyQt rewritten so they actually work with MyPy. |
mypy is now running on Travis CI! There's still a long way to go as not much code is annotated right now, but it's a good start. |
qutebrowser is now using mypy's This requires quite some I'll update the original post with some more TODO items about things I've learned along the way. |
Might be interesting to use diff-cover to enforce any new code to have type annotations. See pytest-dev/pytest#6486 for an example. edit: I added |
Also note that mypy has a pretty nice HTML report feature nowadays - if you run The ones marked in red are places which likely will need more work (and probably don't have type annotations at all yet). |
Not done by default with "tox -e mypy" because it disables mypy's caching, causing its runtime to go from <1s to ~15s: python/mypy#9041 See #1456
As mypy seems a lot more usable than when I last looked at it, maybe qutebrowser should start using PEP484 type hints.
PyQt 5.6 also comes with
.pyi
files for the whole PyQt, so that might already be beneficial before starting to annotate qutebrowser source.check_untyped_defs
runningtyping.
prefix and import things fromtyping
instead# FIXME:typing
commentsThe text was updated successfully, but these errors were encountered: