Move some protocol definitions closer to their usage sites (#8436)

This commit is contained in:
Alex Waygood
2022-07-29 14:26:27 +01:00
committed by GitHub
parent aba4bbd13b
commit 553700e355
4 changed files with 17 additions and 20 deletions

View File

@@ -5,7 +5,7 @@ import types
from _typeshed import Self, WriteableBuffer
from collections.abc import Callable, Iterable, Iterator, Mapping
from socket import socket
from typing import IO, Any, BinaryIO, Protocol, TypeVar, overload
from typing import IO, Any, BinaryIO, TypeVar, overload
from typing_extensions import TypeAlias
__all__ = [
@@ -137,18 +137,6 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO):
def getcode(self) -> int: ...
def begin(self) -> None: ...
# This is an API stub only for the class below, not a class itself.
# urllib.request uses it for a parameter.
class _HTTPConnectionProtocol(Protocol):
def __call__(
self,
host: str,
port: int | None = ...,
timeout: float = ...,
source_address: tuple[str, int] | None = ...,
blocksize: int = ...,
) -> HTTPConnection: ...
class HTTPConnection:
auto_open: int # undocumented
debuglevel: int