-
Notifications
You must be signed in to change notification settings - Fork 270
Investigate the use of type hints #457
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
Comments
It's Python 3 only, there are third party libraries like mypy that have some degree of Python 2 support (with a preprocessor that strips the type annotations I believe). |
Closing, we can reopen in the future if we drop python 2 support. |
In Python 3.6 there will supposedly be a way to do this in comments that is compatible with Python 2.7 and 3.6. So we could do this if we drop support for 3.x for x < 6 once 3.6 is released. Alternatively we could drop support for Python 2.7 and "do it the right way". That's my preference. With the popularity of anaconda I'm skeptical that there is a real need to continue supporting Python 2. We could also get rid of the warnings in #476. |
Perhaps we could wait for 3.7 so we still have the last two 3s? What advantages do type hints give us? (I don't know what they are. If an explanation is too complicated I'll look it up :) Just being lazy.) I understand that it's about performance, would we need to go back and annotate a bunch of code?
I think it's still too early to drop py2... Slightly related: https://python3statement.github.io/ Could be nice to include us on there? |
Type hints just indicate what the types of variables are for function arguments and return variables, and they can be explicit, like |
Cool, so we wouldn't have to go back and annotate but we could? |
Exactly. |
We could use the annotations instead of numpy style docstrings. There's a sphinx extension that will render the docs from them. |
Here's the extension: https://pypi.python.org/pypi/sphinx-autodoc-annotation/1.0 |
Closing re: #808 |
See discussion on #454.
The text was updated successfully, but these errors were encountered: