mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-30 06:35:22 +08:00
Big diff: use lower-case list and dict (#5888)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from abc import abstractmethod
|
||||
from types import TracebackType
|
||||
from typing import IO, Callable, Dict, List, MutableMapping, Optional, Tuple, Type
|
||||
from typing import IO, Callable, MutableMapping, Optional, Tuple, Type
|
||||
|
||||
from .headers import Headers
|
||||
from .types import ErrorStream, InputStream, StartResponse, WSGIApplication, WSGIEnvironment
|
||||
@@ -9,7 +9,7 @@ from .util import FileWrapper
|
||||
_exc_info = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]
|
||||
|
||||
def format_date_time(timestamp: float | None) -> str: ... # undocumented
|
||||
def read_environ() -> Dict[str, str]: ...
|
||||
def read_environ() -> dict[str, str]: ...
|
||||
|
||||
class BaseHandler:
|
||||
wsgi_version: Tuple[int, int] # undocumented
|
||||
@@ -28,7 +28,7 @@ class BaseHandler:
|
||||
|
||||
traceback_limit: int | None
|
||||
error_status: str
|
||||
error_headers: List[Tuple[str, str]]
|
||||
error_headers: list[Tuple[str, str]]
|
||||
error_body: bytes
|
||||
def run(self, application: WSGIApplication) -> None: ...
|
||||
def setup_environ(self) -> None: ...
|
||||
@@ -37,7 +37,7 @@ class BaseHandler:
|
||||
def set_content_length(self) -> None: ...
|
||||
def cleanup_headers(self) -> None: ...
|
||||
def start_response(
|
||||
self, status: str, headers: List[Tuple[str, str]], exc_info: _exc_info | None = ...
|
||||
self, status: str, headers: list[Tuple[str, str]], exc_info: _exc_info | None = ...
|
||||
) -> Callable[[bytes], None]: ...
|
||||
def send_preamble(self) -> None: ...
|
||||
def write(self, data: bytes) -> None: ...
|
||||
@@ -49,7 +49,7 @@ class BaseHandler:
|
||||
def client_is_modern(self) -> bool: ...
|
||||
def log_exception(self, exc_info: _exc_info) -> None: ...
|
||||
def handle_error(self) -> None: ...
|
||||
def error_output(self, environ: WSGIEnvironment, start_response: StartResponse) -> List[bytes]: ...
|
||||
def error_output(self, environ: WSGIEnvironment, start_response: StartResponse) -> list[bytes]: ...
|
||||
@abstractmethod
|
||||
def _write(self, data: bytes) -> None: ...
|
||||
@abstractmethod
|
||||
|
||||
@@ -11,13 +11,13 @@ class Headers:
|
||||
def __delitem__(self, name: str) -> None: ...
|
||||
def __getitem__(self, name: str) -> str | None: ...
|
||||
def __contains__(self, name: str) -> bool: ...
|
||||
def get_all(self, name: str) -> List[str]: ...
|
||||
def get_all(self, name: str) -> list[str]: ...
|
||||
@overload
|
||||
def get(self, name: str, default: str) -> str: ...
|
||||
@overload
|
||||
def get(self, name: str, default: str | None = ...) -> str | None: ...
|
||||
def keys(self) -> List[str]: ...
|
||||
def values(self) -> List[str]: ...
|
||||
def keys(self) -> list[str]: ...
|
||||
def values(self) -> list[str]: ...
|
||||
def items(self) -> _HeaderList: ...
|
||||
def __bytes__(self) -> bytes: ...
|
||||
def setdefault(self, name: str, value: str) -> str: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from http.server import BaseHTTPRequestHandler, HTTPServer
|
||||
from typing import List, Type, TypeVar, overload
|
||||
from typing import Type, TypeVar, overload
|
||||
|
||||
from .handlers import SimpleHandler
|
||||
from .types import ErrorStream, StartResponse, WSGIApplication, WSGIEnvironment
|
||||
@@ -25,7 +25,7 @@ class WSGIRequestHandler(BaseHTTPRequestHandler):
|
||||
def get_stderr(self) -> ErrorStream: ...
|
||||
def handle(self) -> None: ...
|
||||
|
||||
def demo_app(environ: WSGIEnvironment, start_response: StartResponse) -> List[bytes]: ...
|
||||
def demo_app(environ: WSGIEnvironment, start_response: StartResponse) -> list[bytes]: ...
|
||||
|
||||
_S = TypeVar("_S", bound=WSGIServer)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user