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

Enable mypy #362

Draft
wants to merge 16 commits into
base: develop
Choose a base branch
from
Draft

Conversation

gazpachoking
Copy link
Contributor

@gazpachoking gazpachoking commented Feb 5, 2022

This isn't an actual pull request proposal yet, this was just playing around with getting mypy working, and I wanted a specific place to discuss mypy rather than in the other type hint ticket. This is on top of the current typing and maybe_coroutine PR branches, so diff has got more than just mypy fixes atm.

  • What's the plan for python 3.6 support? I was thinking about the nicest way we could start doing type hinting, and I think my plan revolves around dropping that. If we drop it, we can enable from __future__ import annotations to make all the annotations just strings, so they don't have to actually run. If we do that, then we can run mypy on python 3.9+, where builtin types got type hinting support (dict vs typing.Dict) or even 3.10, where we got the pipe operator for union (str | int vs typing.Union[str, int]) I think both of those would go a long way towards readability, especially if we start using them to generate the autodocs for the api. I'm fairly certain that the invalid syntax of the type hints on python 3.7 and 3.8 won't matter as long as we do the docs generation and mypy on 3.10+ EDIT: After fixing up my other PRs, I realized we can achieve the same thing by just quotes around any syntaxes that aren't supported in older pythons.

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.

1 participant