Add type annotations#279
Merged
frostming merged 3 commits intopsf:masterfrom May 30, 2023
dimbleby:type-checking
Merged
Conversation
dimbleby
commented
Jul 4, 2022
dimbleby
commented
Jul 4, 2022
| except NameError: | ||
| text_type = str | ||
|
|
||
| __all__ = ["urljoin", "pickle", "HTTPResponse", "is_fp_closed", "text_type"] |
Contributor
Author
There was a problem hiding this comment.
since setup.py requires python3 https://github.com/ionrock/cachecontrol/blob/6155c199438bfc3944a833f1dec6fb74134476f1/setup.py#L27
I suppose some or more of this file could be removed
mr-c
added a commit
to common-workflow-language/schema_salad
that referenced
this pull request
Sep 13, 2022
Contributor
|
These are great! We had a very minimal set of type hints for cachecontrol; and I updated our type hints to match yours in common-workflow-language/schema_salad@be8da2e ; and our type checking still pass. One note would be to add a |
mr-c
added a commit
to common-workflow-language/schema_salad
that referenced
this pull request
Sep 13, 2022
Contributor
|
I would love to see this merged and in the next release :-) This PR also adds |
frostming
requested changes
May 29, 2023
frostming
approved these changes
May 30, 2023
frostming
approved these changes
May 30, 2023
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.
I probably should have checked first whether this is something you even want, but if the answer is "no thanks" then fair enough: it wasn't so much work that either of us need feel bad about that.
I've added type annotations everywhere, and mypy configuration to check them. I haven't tried to update your github workflows, but all you should need to do is run like this: