Added inline type annotations to Babel#934
Merged
akx merged 34 commits intopython-babel:masterfrom Jan 11, 2023
Merged
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 <spencerb21@live.com>
akx
reviewed
Jan 7, 2023
akx
requested changes
Jan 7, 2023
Member
akx
left a comment
There was a problem hiding this comment.
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 <akx@iki.fi>
* 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
Contributor
Author
This is a good start, maybe we can consider running Black on the whole project to give it some consistency? |
akx
requested changes
Jan 11, 2023
Member
akx
left a comment
There was a problem hiding this comment.
@DenverCoder1 Let's ship this! ... Can you merge/rebase once more with #943 in?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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