-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Update definition of constants in urllib3.util.retry #6892
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
Merged
Merged
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
dc5908e
Update definition of constants in urllib3.util.retry
bugant 3590543
DEFAULT_REMOVE_HEADERS_ON_REDIRECT is a frozenset[str]
bugant d37248a
Mark default values as ClassVar
bugant 95cb6ce
Remove deprecated constants and add more precise types for attributes
bugant e8e45d9
Update attributes and methods typing
bugant 690c081
Use nex syntax for typing
bugant 7c87b9d
Removing is_forced_retry unused stubs from allowedlist
bugant 7cd4351
Set default parameter values in methods
bugant 9b885ff
Fix black
bugant 13a0914
Fixing flake8 issues
bugant 7bcf372
Make urllib3 stubs consistent with the latest release
bugant b2e7e68
Add precise typing for attributes
bugant 4e509dd
Make type more precise and add return types in methods
bugant 7960ed1
Proper class definition for RequestHistory
bugant a604f0c
Fix black
bugant c4ca733
Add missing type annotations in methods
bugant 298f89f
format code with black
bugant bf3f7bf
Type new to be correct for sub-classes
bugant 39296b9
Add missing type for self
bugant File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
At runtime this will return an instance of a subclass if it's being called on a subclass of
Retry
, so we should use aTypeVar
to annotate the return-type instead of hardcoding it. (This is different to how they've annotated their code onmain
, but I think their annotation is wrong.) typeshed's established style is to use the_typeshed.Self
TypeVar
for these situations (you'll need to dofrom _typeshed import Self
at the top of the file).