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

Add Python type hints #319

Closed
Thomas125 opened this issue Mar 6, 2020 · 1 comment · Fixed by #2459
Closed

Add Python type hints #319

Thomas125 opened this issue Mar 6, 2020 · 1 comment · Fixed by #2459
Assignees
Labels
⁉️ prio: low Not urgent, can be resolved in the distant future. 😱 effort: high Big change, which requires >12h
Milestone

Comments

@Thomas125
Copy link
Contributor

Thomas125 commented Mar 6, 2020

Enforce type-annotation, see:

@Thomas125 Thomas125 added the ⁉️ prio: low Not urgent, can be resolved in the distant future. label Mar 6, 2020
@timobrembeck timobrembeck added this to the Additional Features milestone Mar 7, 2020
@timobrembeck timobrembeck added the 😱 effort: high Big change, which requires >12h label Jan 14, 2023
@timobrembeck timobrembeck changed the title Enforce Types Add Python type hints Jan 14, 2023
@timobrembeck
Copy link
Member

To check the type hints, we can use mypy: https://mypy-lang.org/

Does anybody know a good tool to convert our current type hints from the docstrings into the real type hint syntax?
Essentially, this was what https://github.com/tox-dev/sphinx-autodoc-typehints is doing, but sphinx only uses this to write the documentation, not to update the source code itself. Maybe we could still use this somehow?

Another possibility is to create stub files with stubgen and read them into the source code with retype, but this still requires a lot of manual work to fix all inconsistencies and incomplete types.

I started working on this on the typing branch, but there is still much work to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⁉️ prio: low Not urgent, can be resolved in the distant future. 😱 effort: high Big change, which requires >12h
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants