-
Notifications
You must be signed in to change notification settings - Fork 451
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
Added inline type annotations to Babel #934
Conversation
Codecov Report
@@ Coverage Diff @@
## master #934 +/- ##
==========================================
+ Coverage 91.63% 91.78% +0.15%
==========================================
Files 23 23
Lines 4279 4348 +69
==========================================
+ Hits 3921 3991 +70
+ Misses 358 357 -1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Mostly from python/typeshed#9455 Co-authored-by: Spencer Brown <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this work in!
I made a bunch of suggestions around readability (you can probably use GitHub's "commit suggestions in batch" thing to apply them), and then there were some somewhat suspect types wrt. docstrings.
Co-authored-by: Aarni Koskela <[email protected]>
* Added more type annotations to checkers.py * Changed str to Final[str] * Added parse_template_string option * Type aliases for extraction results
* Fix Final on Python 3.7 (use typing_extensions) * Change po fileobj type * overload get_territory_currencies return type
This is a good start, maybe we can consider running Black on the whole project to give it some consistency? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DenverCoder1 Let's ship this! ... Can you merge/rebase once more with #943 in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
This PR adds inline type annotations to the public methods and classes in Babel.
This PR tries to focus on only adding correct type annotations. There are still some Pyright warnings due to non-type-safe implementations which can be fixed at a later time.
Most of the annotations have already been reviewed and approved by typeshed.
Tested on Python 3.7 - 3.11