mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import sys
|
||||
from socket import SocketType
|
||||
from typing import Any, BinaryIO, Callable, ClassVar, List, Text, Tuple, Union
|
||||
from typing import Any, BinaryIO, Callable, ClassVar, Text, Union
|
||||
|
||||
class BaseServer:
|
||||
address_family: int
|
||||
RequestHandlerClass: Callable[..., BaseRequestHandler]
|
||||
server_address: Tuple[str, int]
|
||||
server_address: tuple[str, int]
|
||||
socket: SocketType
|
||||
allow_reuse_address: bool
|
||||
request_queue_size: int
|
||||
@@ -17,19 +17,19 @@ class BaseServer:
|
||||
def serve_forever(self, poll_interval: float = ...) -> None: ...
|
||||
def shutdown(self) -> None: ...
|
||||
def server_close(self) -> None: ...
|
||||
def finish_request(self, request: bytes, client_address: Tuple[str, int]) -> None: ...
|
||||
def get_request(self) -> Tuple[SocketType, Tuple[str, int]]: ...
|
||||
def handle_error(self, request: bytes, client_address: Tuple[str, int]) -> None: ...
|
||||
def finish_request(self, request: bytes, client_address: tuple[str, int]) -> None: ...
|
||||
def get_request(self) -> tuple[SocketType, tuple[str, int]]: ...
|
||||
def handle_error(self, request: bytes, client_address: tuple[str, int]) -> None: ...
|
||||
def handle_timeout(self) -> None: ...
|
||||
def process_request(self, request: bytes, client_address: Tuple[str, int]) -> None: ...
|
||||
def process_request(self, request: bytes, client_address: tuple[str, int]) -> None: ...
|
||||
def server_activate(self) -> None: ...
|
||||
def server_bind(self) -> None: ...
|
||||
def verify_request(self, request: bytes, client_address: Tuple[str, int]) -> bool: ...
|
||||
def verify_request(self, request: bytes, client_address: tuple[str, int]) -> bool: ...
|
||||
|
||||
class TCPServer(BaseServer):
|
||||
def __init__(
|
||||
self,
|
||||
server_address: Tuple[str, int],
|
||||
server_address: tuple[str, int],
|
||||
RequestHandlerClass: Callable[..., BaseRequestHandler],
|
||||
bind_and_activate: bool = ...,
|
||||
) -> None: ...
|
||||
@@ -37,7 +37,7 @@ class TCPServer(BaseServer):
|
||||
class UDPServer(BaseServer):
|
||||
def __init__(
|
||||
self,
|
||||
server_address: Tuple[str, int],
|
||||
server_address: tuple[str, int],
|
||||
RequestHandlerClass: Callable[..., BaseRequestHandler],
|
||||
bind_and_activate: bool = ...,
|
||||
) -> None: ...
|
||||
@@ -61,16 +61,16 @@ if sys.platform != "win32":
|
||||
if sys.platform != "win32":
|
||||
class ForkingMixIn:
|
||||
timeout: float | None # undocumented
|
||||
active_children: List[int] | None # undocumented
|
||||
active_children: list[int] | None # undocumented
|
||||
max_children: int # undocumented
|
||||
def collect_children(self) -> None: ... # undocumented
|
||||
def handle_timeout(self) -> None: ... # undocumented
|
||||
def process_request(self, request: bytes, client_address: Tuple[str, int]) -> None: ...
|
||||
def process_request(self, request: bytes, client_address: tuple[str, int]) -> None: ...
|
||||
|
||||
class ThreadingMixIn:
|
||||
daemon_threads: bool
|
||||
def process_request_thread(self, request: bytes, client_address: Tuple[str, int]) -> None: ... # undocumented
|
||||
def process_request(self, request: bytes, client_address: Tuple[str, int]) -> None: ...
|
||||
def process_request_thread(self, request: bytes, client_address: tuple[str, int]) -> None: ... # undocumented
|
||||
def process_request(self, request: bytes, client_address: tuple[str, int]) -> None: ...
|
||||
|
||||
if sys.platform != "win32":
|
||||
class ForkingTCPServer(ForkingMixIn, TCPServer): ...
|
||||
|
||||
Reference in New Issue
Block a user