-
Notifications
You must be signed in to change notification settings - Fork 4
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
Provide Type Annotations (PEP 484) #14
Comments
Hi @Samylov-Mikhail thanks for opening the issue! In general I think there is a good chance that type annotations and mypy checking (or maybe pyright) could be useful in this library, although I think they are not always helpful. It depends what you are using them for and the nature of the library. In this case I've got a few questions for you:
All of the above questions are another way of asking "what problem are you hoping to solve?"
|
Sorry, I didn't mean to close! |
Hi, Luke. Thank you for the quick feedback!
I'm using
Mostly static type checking to detect issues with my use of the library.
Mostly I thinking from the perspective of a user. Type hints can improve UX for developers like me who use Since the library is stable, I guess type hints won't be enemies of a prospective maintainer. Otherwise we can create third-party type stubs. Benefits of type hints for a maintainer:
Seriously no. I have no real experience with pyright. In mypy compared to pyright I like cool documentation and large community.
Since the codebase isn't so large I'm thinking of adding type hints manually. But I don't mind trying automated tools for that. |
That's sounds great - as long as you are a user and looking at changes that would benefit you as a user, that's great. My only concern is adding lots of stuff that may or may not be helpful. As a maintainer, there are definitely bits I know of that could benefit from types, but there are also bits that would be very hard to type and I wouldn't want you getting stuck with something too ambitious! |
Thank you for your rationality, @spookylukey! |
That sounds fine to me - thanks in advance! |
Good! So I have a plan:
P. S. This plan can be updated. UPDATE: This plan moved to the body of this issue. |
Is there a reason for this? What particularly problem would removing it solve? The Python AST is not stable, and I expect it will continue to have changes, and having a single place to accommodate those changes has been very useful in the past. |
@spookylukey, I've created the issue #19 for that. |
Reasons
Introduction of Type Annotations
ast_compat
module #19SimpleNamespace
fromutils
#21mypy
to run successfully.References
The text was updated successfully, but these errors were encountered: