mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-18 07:44:13 +08:00
Add defaults to third-party stubs U-Z (#9971)
This commit is contained in:
@@ -8,34 +8,34 @@ STRBUF_LIMIT: int
|
||||
class FileBasedBuffer:
|
||||
remain: int = ...
|
||||
file: BytesIO = ...
|
||||
def __init__(self, file: BytesIO, from_buffer: BytesIO | None = ...) -> None: ...
|
||||
def __init__(self, file: BytesIO, from_buffer: BytesIO | None = None) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __nonzero__(self) -> bool: ...
|
||||
__bool__: Callable[[], bool] = ...
|
||||
def append(self, s: Any) -> None: ...
|
||||
def get(self, numbytes: int = ..., skip: bool = ...) -> bytes: ...
|
||||
def skip(self, numbytes: int, allow_prune: int = ...) -> None: ...
|
||||
def get(self, numbytes: int = -1, skip: bool = False) -> bytes: ...
|
||||
def skip(self, numbytes: int, allow_prune: int = 0) -> None: ...
|
||||
def newfile(self) -> Any: ...
|
||||
def prune(self) -> None: ...
|
||||
def getfile(self) -> Any: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
class TempfileBasedBuffer(FileBasedBuffer):
|
||||
def __init__(self, from_buffer: BytesIO | None = ...) -> None: ...
|
||||
def __init__(self, from_buffer: BytesIO | None = None) -> None: ...
|
||||
def newfile(self) -> BufferedRandom: ...
|
||||
|
||||
class BytesIOBasedBuffer(FileBasedBuffer):
|
||||
file: BytesIO = ...
|
||||
def __init__(self, from_buffer: BytesIO | None = ...) -> None: ...
|
||||
def __init__(self, from_buffer: BytesIO | None = None) -> None: ...
|
||||
def newfile(self) -> BytesIO: ...
|
||||
|
||||
class ReadOnlyFileBasedBuffer(FileBasedBuffer):
|
||||
file: BytesIO = ...
|
||||
block_size: int = ...
|
||||
def __init__(self, file: BytesIO, block_size: int = ...) -> None: ...
|
||||
def __init__(self, file: BytesIO, block_size: int = 32768) -> None: ...
|
||||
remain: int = ...
|
||||
def prepare(self, size: int | None = ...) -> int: ...
|
||||
def get(self, numbytes: int = ..., skip: bool = ...) -> bytes: ...
|
||||
def prepare(self, size: int | None = None) -> int: ...
|
||||
def get(self, numbytes: int = -1, skip: bool = False) -> bytes: ...
|
||||
def __iter__(self) -> ReadOnlyFileBasedBuffer: ...
|
||||
def next(self) -> bytes | None: ...
|
||||
__next__: Callable[[], bytes | None] = ...
|
||||
@@ -51,8 +51,8 @@ class OverflowableBuffer:
|
||||
def __nonzero__(self) -> bool: ...
|
||||
__bool__: Callable[[], bool] = ...
|
||||
def append(self, s: bytes) -> None: ...
|
||||
def get(self, numbytes: int = ..., skip: bool = ...) -> bytes: ...
|
||||
def skip(self, numbytes: int, allow_prune: bool = ...) -> None: ...
|
||||
def get(self, numbytes: int = -1, skip: bool = False) -> bytes: ...
|
||||
def skip(self, numbytes: int, allow_prune: bool = False) -> None: ...
|
||||
def prune(self) -> None: ...
|
||||
def getfile(self) -> BytesIO: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
@@ -33,7 +33,7 @@ class HTTPChannel(wasyncore.dispatcher):
|
||||
outbuf_lock: Condition = ...
|
||||
addr: tuple[str, int] = ...
|
||||
def __init__(
|
||||
self, server: BaseWSGIServer, sock: socket, addr: str, adj: Adjustments, map: Mapping[int, socket] | None = ...
|
||||
self, server: BaseWSGIServer, sock: socket, addr: str, adj: Adjustments, map: Mapping[int, socket] | None = None
|
||||
) -> None: ...
|
||||
def writable(self) -> bool: ...
|
||||
def handle_write(self) -> None: ...
|
||||
@@ -42,8 +42,8 @@ class HTTPChannel(wasyncore.dispatcher):
|
||||
def received(self, data: bytes) -> bool: ...
|
||||
connected: bool = ...
|
||||
def handle_close(self) -> None: ...
|
||||
def add_channel(self, map: Mapping[int, socket] | None = ...) -> None: ...
|
||||
def del_channel(self, map: Mapping[int, socket] | None = ...) -> None: ...
|
||||
def add_channel(self, map: Mapping[int, socket] | None = None) -> None: ...
|
||||
def del_channel(self, map: Mapping[int, socket] | None = None) -> None: ...
|
||||
def write_soon(self, data: bytes) -> int: ...
|
||||
def service(self) -> None: ...
|
||||
def cancel(self) -> None: ...
|
||||
|
||||
@@ -20,11 +20,11 @@ class MalformedProxyHeader(Exception):
|
||||
|
||||
def proxy_headers_middleware(
|
||||
app: Any,
|
||||
trusted_proxy: str | None = ...,
|
||||
trusted_proxy_count: int = ...,
|
||||
trusted_proxy_headers: set[str] | None = ...,
|
||||
clear_untrusted: bool = ...,
|
||||
log_untrusted: bool = ...,
|
||||
trusted_proxy: str | None = None,
|
||||
trusted_proxy_count: int = 1,
|
||||
trusted_proxy_headers: set[str] | None = None,
|
||||
clear_untrusted: bool = True,
|
||||
log_untrusted: bool = False,
|
||||
logger: Logger = ...,
|
||||
) -> Callable[..., Any]: ...
|
||||
def parse_proxy_headers(
|
||||
@@ -32,5 +32,5 @@ def parse_proxy_headers(
|
||||
) -> set[str]: ...
|
||||
def strip_brackets(addr: str) -> str: ...
|
||||
def clear_untrusted_headers(
|
||||
environ: Mapping[str, str], untrusted_headers: Sequence[str], log_warning: bool = ..., logger: Logger = ...
|
||||
environ: Mapping[str, str], untrusted_headers: Sequence[str], log_warning: bool = False, logger: Logger = ...
|
||||
) -> None: ...
|
||||
|
||||
@@ -8,6 +8,6 @@ RUNNER_PATTERN: Pattern[Any]
|
||||
|
||||
def match(obj_name: str) -> tuple[str, str]: ...
|
||||
def resolve(module_name: str, object_name: str) -> Any: ...
|
||||
def show_help(stream: TextIOWrapper, name: str, error: str | None = ...) -> None: ...
|
||||
def show_help(stream: TextIOWrapper, name: str, error: str | None = None) -> None: ...
|
||||
def show_exception(stream: TextIOWrapper) -> None: ...
|
||||
def run(argv: Sequence[str] = ..., _serve: Callable[..., object] = ...) -> None: ...
|
||||
|
||||
@@ -11,10 +11,10 @@ from waitress.task import Task, ThreadedTaskDispatcher
|
||||
|
||||
def create_server(
|
||||
application: Any,
|
||||
map: Incomplete | None = ...,
|
||||
_start: bool = ...,
|
||||
_sock: socket | None = ...,
|
||||
_dispatcher: ThreadedTaskDispatcher | None = ...,
|
||||
map: Incomplete | None = None,
|
||||
_start: bool = True,
|
||||
_sock: socket | None = None,
|
||||
_dispatcher: ThreadedTaskDispatcher | None = None,
|
||||
**kw: Any,
|
||||
) -> MultiSocketServer | BaseWSGIServer: ...
|
||||
|
||||
@@ -26,10 +26,10 @@ class MultiSocketServer:
|
||||
task_dispatcher: ThreadedTaskDispatcher = ...
|
||||
def __init__(
|
||||
self,
|
||||
map: Incomplete | None = ...,
|
||||
adj: Adjustments | None = ...,
|
||||
effective_listen: Sequence[tuple[str, int]] | None = ...,
|
||||
dispatcher: ThreadedTaskDispatcher | None = ...,
|
||||
map: Incomplete | None = None,
|
||||
adj: Adjustments | None = None,
|
||||
effective_listen: Sequence[tuple[str, int]] | None = None,
|
||||
dispatcher: ThreadedTaskDispatcher | None = None,
|
||||
) -> None: ...
|
||||
def print_listen(self, format_str: str) -> None: ...
|
||||
def run(self) -> None: ...
|
||||
@@ -52,13 +52,13 @@ class BaseWSGIServer(wasyncore.dispatcher):
|
||||
def __init__(
|
||||
self,
|
||||
application: Any,
|
||||
map: Incomplete | None = ...,
|
||||
_start: bool = ...,
|
||||
_sock: Incomplete | None = ...,
|
||||
dispatcher: ThreadedTaskDispatcher | None = ...,
|
||||
adj: Adjustments | None = ...,
|
||||
sockinfo: Incomplete | None = ...,
|
||||
bind_socket: bool = ...,
|
||||
map: Incomplete | None = None,
|
||||
_start: bool = True,
|
||||
_sock: Incomplete | None = None,
|
||||
dispatcher: ThreadedTaskDispatcher | None = None,
|
||||
adj: Adjustments | None = None,
|
||||
sockinfo: Incomplete | None = None,
|
||||
bind_socket: bool = True,
|
||||
**kw: Any,
|
||||
) -> None: ...
|
||||
def bind_server_socket(self) -> None: ...
|
||||
|
||||
@@ -25,7 +25,7 @@ class ThreadedTaskDispatcher:
|
||||
def handler_thread(self, thread_no: int) -> None: ...
|
||||
def set_thread_count(self, count: int) -> None: ...
|
||||
def add_task(self, task: Task) -> None: ...
|
||||
def shutdown(self, cancel_pending: bool = ..., timeout: int = ...) -> bool: ...
|
||||
def shutdown(self, cancel_pending: bool = True, timeout: int = 5) -> bool: ...
|
||||
|
||||
class Task:
|
||||
close_on_finish: bool = ...
|
||||
|
||||
@@ -15,7 +15,7 @@ class _triggerbase:
|
||||
def handle_connect(self) -> None: ...
|
||||
def handle_close(self) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def pull_trigger(self, thunk: Callable[[None], object] | None = ...) -> None: ...
|
||||
def pull_trigger(self, thunk: Callable[[None], object] | None = None) -> None: ...
|
||||
def handle_read(self) -> None: ...
|
||||
|
||||
if sys.platform != "win32":
|
||||
|
||||
@@ -9,7 +9,7 @@ queue_logger: Logger
|
||||
|
||||
def find_double_newline(s: bytes) -> int: ...
|
||||
def concat(*args: Any) -> str: ...
|
||||
def join(seq: Any, field: str = ...) -> str: ...
|
||||
def join(seq: Any, field: str = " ") -> str: ...
|
||||
def group(s: Any) -> str: ...
|
||||
|
||||
short_days: Sequence[str]
|
||||
|
||||
@@ -18,12 +18,14 @@ class ExitNow(Exception): ...
|
||||
def read(obj: dispatcher) -> None: ...
|
||||
def write(obj: dispatcher) -> None: ...
|
||||
def readwrite(obj: dispatcher, flags: int) -> None: ...
|
||||
def poll(timeout: float = ..., map: Mapping[int, socket] | None = ...) -> None: ...
|
||||
def poll2(timeout: float = ..., map: Mapping[int, socket] | None = ...) -> None: ...
|
||||
def poll(timeout: float = 0.0, map: Mapping[int, socket] | None = None) -> None: ...
|
||||
def poll2(timeout: float = 0.0, map: Mapping[int, socket] | None = None) -> None: ...
|
||||
|
||||
poll3 = poll2
|
||||
|
||||
def loop(timeout: float = ..., use_poll: bool = ..., map: Mapping[int, socket] | None = ..., count: int | None = ...) -> None: ...
|
||||
def loop(
|
||||
timeout: float = 30.0, use_poll: bool = False, map: Mapping[int, socket] | None = None, count: int | None = None
|
||||
) -> None: ...
|
||||
def compact_traceback() -> tuple[tuple[str, str, str], BaseException, BaseException, str]: ...
|
||||
|
||||
class dispatcher:
|
||||
@@ -37,12 +39,12 @@ class dispatcher:
|
||||
logger: Logger = ...
|
||||
compact_traceback: Callable[[], tuple[tuple[str, str, str], BaseException, BaseException, str]] = ...
|
||||
socket: _Socket | None = ...
|
||||
def __init__(self, sock: _Socket | None = ..., map: Mapping[int, _Socket] | None = ...) -> None: ...
|
||||
def add_channel(self, map: Mapping[int, _Socket] | None = ...) -> None: ...
|
||||
def del_channel(self, map: Mapping[int, _Socket] | None = ...) -> None: ...
|
||||
def __init__(self, sock: _Socket | None = None, map: Mapping[int, _Socket] | None = None) -> None: ...
|
||||
def add_channel(self, map: Mapping[int, _Socket] | None = None) -> None: ...
|
||||
def del_channel(self, map: Mapping[int, _Socket] | None = None) -> None: ...
|
||||
family_and_type: tuple[int, int] = ...
|
||||
def create_socket(self, family: int = ..., type: int = ...) -> None: ...
|
||||
def set_socket(self, sock: _Socket, map: Mapping[int, _Socket] | None = ...) -> None: ...
|
||||
def set_socket(self, sock: _Socket, map: Mapping[int, _Socket] | None = None) -> None: ...
|
||||
def set_reuse_addr(self) -> None: ...
|
||||
def readable(self) -> bool: ...
|
||||
def writable(self) -> bool: ...
|
||||
@@ -50,11 +52,11 @@ class dispatcher:
|
||||
def bind(self, addr: tuple[str, int]) -> None: ...
|
||||
def connect(self, address: tuple[str, int]) -> None: ...
|
||||
def accept(self) -> tuple[_Socket, tuple[str, int]] | None: ...
|
||||
def send(self, data: bytes, do_close: bool = ...) -> int: ...
|
||||
def send(self, data: bytes, do_close: bool = True) -> int: ...
|
||||
def recv(self, buffer_size: int) -> bytes: ...
|
||||
def close(self) -> None: ...
|
||||
def log(self, message: str) -> None: ...
|
||||
def log_info(self, message: str, type: str = ...) -> None: ...
|
||||
def log_info(self, message: str, type: str = "info") -> None: ...
|
||||
def handle_read_event(self) -> None: ...
|
||||
def handle_connect_event(self) -> None: ...
|
||||
def handle_write_event(self) -> None: ...
|
||||
@@ -70,13 +72,13 @@ class dispatcher:
|
||||
|
||||
class dispatcher_with_send(dispatcher):
|
||||
out_buffer: bytes = ...
|
||||
def __init__(self, sock: socket | None = ..., map: Mapping[int, socket] | None = ...) -> None: ...
|
||||
def __init__(self, sock: socket | None = None, map: Mapping[int, socket] | None = None) -> None: ...
|
||||
def initiate_send(self) -> None: ...
|
||||
handle_write: Callable[[], None] = ...
|
||||
def writable(self) -> bool: ...
|
||||
def send(self, data: bytes) -> None: ... # type: ignore[override]
|
||||
|
||||
def close_all(map: Mapping[int, socket] | None = ..., ignore_all: bool = ...) -> None: ...
|
||||
def close_all(map: Mapping[int, socket] | None = None, ignore_all: bool = False) -> None: ...
|
||||
|
||||
if sys.platform != "win32":
|
||||
class file_wrapper:
|
||||
|
||||
Reference in New Issue
Block a user