mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
timeout argument to urllib.request.urlopen is Optional (#3487)
The docs (https://docs.python.org/3/library/urllib.request.html#urllib.request.urlopen) aren't very precise about this, but passing `None` seems to work in practice.
This commit is contained in:
committed by
Sebastian Rittau
parent
a89f883878
commit
1f0dc6ee05
@@ -21,7 +21,7 @@ class _HTTPResponse(HTTPResponse):
|
||||
|
||||
def urlopen(
|
||||
url: Union[str, Request], data: Optional[bytes] = ...,
|
||||
timeout: float = ..., *, cafile: Optional[str] = ...,
|
||||
timeout: Optional[float] = ..., *, cafile: Optional[str] = ...,
|
||||
capath: Optional[str] = ..., cadefault: bool = ...,
|
||||
context: Optional[ssl.SSLContext] = ...
|
||||
) -> _UrlopenRet: ...
|
||||
@@ -71,7 +71,7 @@ class OpenerDirector:
|
||||
addheaders: List[Tuple[str, str]]
|
||||
def add_handler(self, handler: BaseHandler) -> None: ...
|
||||
def open(self, url: Union[str, Request], data: Optional[bytes] = ...,
|
||||
timeout: float = ...) -> _UrlopenRet: ...
|
||||
timeout: Optional[float] = ...) -> _UrlopenRet: ...
|
||||
def error(self, proto: str, *args: Any) -> _UrlopenRet: ...
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user