-
Notifications
You must be signed in to change notification settings - Fork 438
Improved typing #899
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 seems like a lot of work and some of the constructor functions (like Since type hints don't affect run-time, can you say more about when/how they are useful (over a well written docstring, for example)? |
Indeed, but if we use monkeytype it's automatically done within a few lines... Just tested it here and it works until hit circular imports. Circular imports is something I really dislike about Python, this lack of compilation makes the work with modules so limiting...
To be sincere, someone could list dozens of good reasons to embrace type hints, but for me, the only practical reason is to be able to run static checks in my codebase. |
It is worth noting that currently quite a few functions (including This is really frustrating if you have type checking enabled (I generally always have type checking enabled, because even in a largely untyped codebase it helps catch a lot of typos and simple mistakes). It would be nice to at least mark such arguments as |
The compromising solution for this we did on SciPy is to use Also this makes, contributions much easier for them to send PR for one or multiple |
Hi,
I love this library, but it is a bit frustrating to interact with it when trying to use typed Python.
I want to know if there is interest in adding type hints, at least to the API.
As an example, we would change from this:
to something like this:
To do this, monkeytype from Instagram might be a good initial step... But I think we might need a major refactor to get rid of circular imports.
What's everybody's opinion about this?
Thanks
The text was updated successfully, but these errors were encountered: