mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-23 19:41:51 +08:00
Remove Python 3.6 branches from typeshed (#8269)
This commit is contained in:
@@ -72,8 +72,7 @@ class HTTPStatus(IntEnum):
|
||||
LOOP_DETECTED: int
|
||||
NOT_EXTENDED: int
|
||||
NETWORK_AUTHENTICATION_REQUIRED: int
|
||||
if sys.version_info >= (3, 7):
|
||||
MISDIRECTED_REQUEST: int
|
||||
MISDIRECTED_REQUEST: int
|
||||
if sys.version_info >= (3, 8):
|
||||
UNAVAILABLE_FOR_LEGAL_REASONS: int
|
||||
if sys.version_info >= (3, 9):
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import email.message
|
||||
import io
|
||||
import ssl
|
||||
import sys
|
||||
import types
|
||||
from _typeshed import Self, WriteableBuffer
|
||||
from collections.abc import Callable, Iterable, Iterator, Mapping
|
||||
@@ -141,19 +140,14 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO):
|
||||
# This is an API stub only for the class below, not a class itself.
|
||||
# urllib.request uses it for a parameter.
|
||||
class _HTTPConnectionProtocol(Protocol):
|
||||
if sys.version_info >= (3, 7):
|
||||
def __call__(
|
||||
self,
|
||||
host: str,
|
||||
port: int | None = ...,
|
||||
timeout: float = ...,
|
||||
source_address: tuple[str, int] | None = ...,
|
||||
blocksize: int = ...,
|
||||
) -> HTTPConnection: ...
|
||||
else:
|
||||
def __call__(
|
||||
self, host: str, port: int | None = ..., timeout: float = ..., source_address: tuple[str, int] | None = ...
|
||||
) -> HTTPConnection: ...
|
||||
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
|
||||
@@ -164,20 +158,14 @@ class HTTPConnection:
|
||||
host: str
|
||||
port: int
|
||||
sock: Any
|
||||
if sys.version_info >= (3, 7):
|
||||
def __init__(
|
||||
self,
|
||||
host: str,
|
||||
port: int | None = ...,
|
||||
timeout: float | None = ...,
|
||||
source_address: tuple[str, int] | None = ...,
|
||||
blocksize: int = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self, host: str, port: int | None = ..., timeout: float | None = ..., source_address: tuple[str, int] | None = ...
|
||||
) -> None: ...
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
host: str,
|
||||
port: int | None = ...,
|
||||
timeout: float | None = ...,
|
||||
source_address: tuple[str, int] | None = ...,
|
||||
blocksize: int = ...,
|
||||
) -> None: ...
|
||||
def request(
|
||||
self, method: str, url: str, body: _DataType | None = ..., headers: Mapping[str, str] = ..., *, encode_chunked: bool = ...
|
||||
) -> None: ...
|
||||
@@ -192,33 +180,19 @@ class HTTPConnection:
|
||||
def send(self, data: _DataType) -> None: ...
|
||||
|
||||
class HTTPSConnection(HTTPConnection):
|
||||
if sys.version_info >= (3, 7):
|
||||
def __init__(
|
||||
self,
|
||||
host: str,
|
||||
port: int | None = ...,
|
||||
key_file: str | None = ...,
|
||||
cert_file: str | None = ...,
|
||||
timeout: float | None = ...,
|
||||
source_address: tuple[str, int] | None = ...,
|
||||
*,
|
||||
context: ssl.SSLContext | None = ...,
|
||||
check_hostname: bool | None = ...,
|
||||
blocksize: int = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
host: str,
|
||||
port: int | None = ...,
|
||||
key_file: str | None = ...,
|
||||
cert_file: str | None = ...,
|
||||
timeout: float | None = ...,
|
||||
source_address: tuple[str, int] | None = ...,
|
||||
*,
|
||||
context: ssl.SSLContext | None = ...,
|
||||
check_hostname: bool | None = ...,
|
||||
) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
host: str,
|
||||
port: int | None = ...,
|
||||
key_file: str | None = ...,
|
||||
cert_file: str | None = ...,
|
||||
timeout: float | None = ...,
|
||||
source_address: tuple[str, int] | None = ...,
|
||||
*,
|
||||
context: ssl.SSLContext | None = ...,
|
||||
check_hostname: bool | None = ...,
|
||||
blocksize: int = ...,
|
||||
) -> None: ...
|
||||
|
||||
class HTTPException(Exception): ...
|
||||
|
||||
|
||||
@@ -30,11 +30,7 @@ class Morsel(dict[str, Any], Generic[_T]):
|
||||
@property
|
||||
def key(self) -> str: ...
|
||||
def __init__(self) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def set(self, key: str, val: str, coded_val: _T) -> None: ...
|
||||
else:
|
||||
def set(self, key: str, val: str, coded_val: _T, LegalChars: str = ...) -> None: ...
|
||||
|
||||
def set(self, key: str, val: str, coded_val: _T) -> None: ...
|
||||
def setdefault(self, key: str, val: str | None = ...) -> str: ...
|
||||
# The dict update can also get a keywords argument so this is incompatible
|
||||
@overload # type: ignore[override]
|
||||
|
||||
@@ -1,23 +1,18 @@
|
||||
import email.message
|
||||
import io
|
||||
import socketserver
|
||||
import sys
|
||||
from _typeshed import StrPath, SupportsRead, SupportsWrite
|
||||
from collections.abc import Mapping, Sequence
|
||||
from typing import Any, AnyStr, BinaryIO, ClassVar
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ = ["HTTPServer", "ThreadingHTTPServer", "BaseHTTPRequestHandler", "SimpleHTTPRequestHandler", "CGIHTTPRequestHandler"]
|
||||
else:
|
||||
__all__ = ["HTTPServer", "BaseHTTPRequestHandler", "SimpleHTTPRequestHandler", "CGIHTTPRequestHandler"]
|
||||
__all__ = ["HTTPServer", "ThreadingHTTPServer", "BaseHTTPRequestHandler", "SimpleHTTPRequestHandler", "CGIHTTPRequestHandler"]
|
||||
|
||||
class HTTPServer(socketserver.TCPServer):
|
||||
server_name: str
|
||||
server_port: int
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
class ThreadingHTTPServer(socketserver.ThreadingMixIn, HTTPServer):
|
||||
daemon_threads: bool # undocumented
|
||||
class ThreadingHTTPServer(socketserver.ThreadingMixIn, HTTPServer):
|
||||
daemon_threads: bool # undocumented
|
||||
|
||||
class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
|
||||
client_address: tuple[str, int]
|
||||
@@ -60,13 +55,9 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
|
||||
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
|
||||
server_version: str
|
||||
extensions_map: dict[str, str]
|
||||
if sys.version_info >= (3, 7):
|
||||
def __init__(
|
||||
self, request: bytes, client_address: tuple[str, int], server: socketserver.BaseServer, directory: str | None = ...
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, request: bytes, client_address: tuple[str, int], server: socketserver.BaseServer) -> None: ...
|
||||
|
||||
def __init__(
|
||||
self, request: bytes, client_address: tuple[str, int], server: socketserver.BaseServer, directory: str | None = ...
|
||||
) -> None: ...
|
||||
def do_GET(self) -> None: ...
|
||||
def do_HEAD(self) -> None: ...
|
||||
def send_head(self) -> io.BytesIO | BinaryIO | None: ... # undocumented
|
||||
|
||||
Reference in New Issue
Block a user