Skip to content
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

Test with mypy and work on adding type annotations #985

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

dairiki
Copy link
Contributor

@dairiki dairiki commented Jan 12, 2022

I've started playing with adding type annotations and testing with mypy.

I think it will be a while before this is merge-ready, but there's enough here to get mypy to run with meaningful results.

(Bugs have already been discovered, proving that this is probably a worthwhile exercise.)

(Run mypy with tox -e mypy. This requires python>=3.8.)

@yagebu
Copy link
Contributor

yagebu commented Jan 14, 2022

Nice :)

One thought: I think we could drop support for Python 3.6 (EOL since December) before adding widespread type annotations, which would allow us to do from __future__ import annotations (postponed evaluation of annotations). That way we could some of the more modern typing features without negative impact on older Python versions, e.g. avoid a lot the imports from typing and use list[str] | None etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants