Added stub for urllib.request.proxy_bypass()#3283
Merged
srittau merged 24 commits intopython:masterfrom Sep 30, 2019
jolaf:proxy_bypass
Merged
Added stub for urllib.request.proxy_bypass()#3283srittau merged 24 commits intopython:masterfrom jolaf:proxy_bypass
srittau merged 24 commits intopython:masterfrom
jolaf:proxy_bypass
Conversation
Make vars arguments Optional, as they default to None (#2853)
…e it should be Union[str, bytes] Fixes #2831
Update from upstream
Missing return values added; A lot of parameters have been made Optional, according to documentation; translation() stub improved by using @overload
Sequence replaced with Container Co-Authored-By: Sebastian Rittau <srittau@rittau.biz>
Sequence replaced with Iterable Co-Authored-By: Sebastian Rittau <srittau@rittau.biz>
Co-Authored-By: Sebastian Rittau <srittau@rittau.biz>
Merge from master
srittau
reviewed
Sep 30, 2019
| def getproxies() -> Dict[str, str]: ... | ||
| def parse_http_list(s: str) -> List[str]: ... | ||
| def parse_keqv_list(l: List[str]) -> Dict[str, str]: ... | ||
| def proxy_bypass(host: str) -> Any: ... # Undocumented |
Collaborator
There was a problem hiding this comment.
Returns int as far as I can see (probably in place of a bool).
Contributor
Author
There was a problem hiding this comment.
Yes it returns int (0 or 1).
However docstring specifies: Return True, if host should be bypassed.
The actual usage of the function in the module shows the typical usage like if proxy_bypass(...):.
This lead me to conclusion that Any is the proper return type, as it allows bool-like checks and doesn't specify the return type precisely which could produce warnings in runtime type checkers like typeguard.
srittau
approved these changes
Sep 30, 2019
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.
Fix for #3282