mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Big diff: use lower-case list and dict (#5888)
This commit is contained in:
@@ -5,23 +5,7 @@ import sys
|
||||
import types
|
||||
from _typeshed import Self, WriteableBuffer
|
||||
from socket import socket
|
||||
from typing import (
|
||||
IO,
|
||||
Any,
|
||||
BinaryIO,
|
||||
Callable,
|
||||
Dict,
|
||||
Iterable,
|
||||
Iterator,
|
||||
List,
|
||||
Mapping,
|
||||
Protocol,
|
||||
Tuple,
|
||||
Type,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
from typing import IO, Any, BinaryIO, Callable, Iterable, Iterator, Mapping, Protocol, Tuple, Type, TypeVar, Union, overload
|
||||
|
||||
_DataType = Union[bytes, IO[Any], Iterable[bytes], str]
|
||||
_T = TypeVar("_T")
|
||||
@@ -87,7 +71,7 @@ INSUFFICIENT_STORAGE: int
|
||||
NOT_EXTENDED: int
|
||||
NETWORK_AUTHENTICATION_REQUIRED: int
|
||||
|
||||
responses: Dict[int, str]
|
||||
responses: dict[int, str]
|
||||
|
||||
class HTTPMessage(email.message.Message):
|
||||
def getallmatchingheaders(self, name: str) -> list[str]: ... # undocumented
|
||||
@@ -112,7 +96,7 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO):
|
||||
def getheader(self, name: str) -> str | None: ...
|
||||
@overload
|
||||
def getheader(self, name: str, default: _T) -> str | _T: ...
|
||||
def getheaders(self) -> List[Tuple[str, str]]: ...
|
||||
def getheaders(self) -> list[Tuple[str, str]]: ...
|
||||
def fileno(self) -> int: ...
|
||||
def isclosed(self) -> bool: ...
|
||||
def __iter__(self) -> Iterator[bytes]: ...
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import StrPath
|
||||
from http.client import HTTPResponse
|
||||
from typing import ClassVar, Dict, Iterable, Iterator, Pattern, Sequence, Tuple, TypeVar, overload
|
||||
from typing import ClassVar, Iterable, Iterator, Pattern, Sequence, Tuple, TypeVar, overload
|
||||
from urllib.request import Request
|
||||
|
||||
_T = TypeVar("_T")
|
||||
@@ -155,7 +155,7 @@ class Cookie:
|
||||
discard: bool,
|
||||
comment: str | None,
|
||||
comment_url: str | None,
|
||||
rest: Dict[str, str],
|
||||
rest: dict[str, str],
|
||||
rfc2109: bool = ...,
|
||||
) -> None: ...
|
||||
def has_nonstandard_attr(self, name: str) -> bool: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Any, Dict, Generic, Iterable, List, Mapping, Tuple, TypeVar, Union, overload
|
||||
from typing import Any, Dict, Generic, Iterable, Mapping, Tuple, TypeVar, Union, overload
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
@@ -34,9 +34,9 @@ class Morsel(Dict[str, Any], Generic[_T]):
|
||||
@overload
|
||||
def update(self, values: Iterable[Tuple[str, str]]) -> None: ...
|
||||
def isReservedKey(self, K: str) -> bool: ...
|
||||
def output(self, attrs: List[str] | None = ..., header: str = ...) -> str: ...
|
||||
def js_output(self, attrs: List[str] | None = ...) -> str: ...
|
||||
def OutputString(self, attrs: List[str] | None = ...) -> str: ...
|
||||
def output(self, attrs: list[str] | None = ..., header: str = ...) -> str: ...
|
||||
def js_output(self, attrs: list[str] | None = ...) -> str: ...
|
||||
def OutputString(self, attrs: list[str] | None = ...) -> str: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
@@ -44,8 +44,8 @@ class BaseCookie(Dict[str, Morsel[_T]], Generic[_T]):
|
||||
def __init__(self, input: _DataType | None = ...) -> None: ...
|
||||
def value_decode(self, val: str) -> _T: ...
|
||||
def value_encode(self, val: _T) -> str: ...
|
||||
def output(self, attrs: List[str] | None = ..., header: str = ..., sep: str = ...) -> str: ...
|
||||
def js_output(self, attrs: List[str] | None = ...) -> str: ...
|
||||
def output(self, attrs: list[str] | None = ..., header: str = ..., sep: str = ...) -> str: ...
|
||||
def js_output(self, attrs: list[str] | None = ...) -> str: ...
|
||||
def load(self, rawdata: _DataType) -> None: ...
|
||||
def __setitem__(self, key: str, value: str | Morsel[_T]) -> None: ...
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import io
|
||||
import socketserver
|
||||
import sys
|
||||
from _typeshed import StrPath, SupportsRead, SupportsWrite
|
||||
from typing import Any, AnyStr, BinaryIO, ClassVar, Dict, List, Mapping, Sequence, Tuple
|
||||
from typing import Any, AnyStr, BinaryIO, ClassVar, Mapping, Sequence, Tuple
|
||||
|
||||
class HTTPServer(socketserver.TCPServer):
|
||||
server_name: str
|
||||
@@ -53,7 +53,7 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
|
||||
|
||||
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
|
||||
server_version: str
|
||||
extensions_map: Dict[str, 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 = ...
|
||||
@@ -71,7 +71,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
|
||||
def executable(path: StrPath) -> bool: ... # undocumented
|
||||
|
||||
class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
|
||||
cgi_directories: List[str]
|
||||
cgi_directories: list[str]
|
||||
have_fork: bool # undocumented
|
||||
def do_POST(self) -> None: ...
|
||||
def is_cgi(self) -> bool: ... # undocumented
|
||||
|
||||
Reference in New Issue
Block a user