From ccc4b7a034d71fa390c28b0b872092ea4c7dd1a7 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 28 Mar 2023 18:33:38 +0100 Subject: [PATCH] Add defaults to third-party stubs U-Z (#9971) --- stubs/urllib3/urllib3/__init__.pyi | 2 +- stubs/urllib3/urllib3/_collections.pyi | 4 +- stubs/urllib3/urllib3/connection.pyi | 6 +- stubs/urllib3/urllib3/connectionpool.pyi | 62 +++++++++---------- stubs/urllib3/urllib3/exceptions.pyi | 4 +- stubs/urllib3/urllib3/fields.pyi | 8 +-- stubs/urllib3/urllib3/filepost.pyi | 2 +- stubs/urllib3/urllib3/poolmanager.pyi | 8 +-- stubs/urllib3/urllib3/request.pyi | 10 +-- stubs/urllib3/urllib3/response.pyi | 42 ++++++------- stubs/urllib3/urllib3/util/connection.pyi | 2 +- stubs/urllib3/urllib3/util/request.pyi | 2 +- stubs/urllib3/urllib3/util/retry.pyi | 44 ++++++------- stubs/urllib3/urllib3/util/ssl_.pyi | 18 +++--- stubs/urllib3/urllib3/util/timeout.pyi | 2 +- stubs/urllib3/urllib3/util/url.pyi | 14 ++--- stubs/vobject/vobject/base.pyi | 62 +++++++++---------- stubs/vobject/vobject/behavior.pyi | 4 +- stubs/vobject/vobject/change_tz.pyi | 2 +- stubs/vobject/vobject/hcalendar.pyi | 2 +- stubs/vobject/vobject/icalendar.pyi | 28 ++++----- stubs/vobject/vobject/ics_diff.pyi | 2 +- stubs/vobject/vobject/vcard.pyi | 22 +++---- stubs/waitress/waitress/buffers.pyi | 20 +++--- stubs/waitress/waitress/channel.pyi | 6 +- stubs/waitress/waitress/proxy_headers.pyi | 12 ++-- stubs/waitress/waitress/runner.pyi | 2 +- stubs/waitress/waitress/server.pyi | 30 ++++----- stubs/waitress/waitress/task.pyi | 2 +- stubs/waitress/waitress/trigger.pyi | 2 +- stubs/waitress/waitress/utilities.pyi | 2 +- stubs/waitress/waitress/wasyncore.pyi | 24 +++---- stubs/whatthepatch/whatthepatch/apply.pyi | 2 +- .../whatthepatch/whatthepatch/exceptions.pyi | 2 +- stubs/zxcvbn/zxcvbn/__init__.pyi | 2 +- stubs/zxcvbn/zxcvbn/scoring.pyi | 4 +- 36 files changed, 233 insertions(+), 229 deletions(-) diff --git a/stubs/urllib3/urllib3/__init__.pyi b/stubs/urllib3/urllib3/__init__.pyi index 12ca61031..8794ea575 100644 --- a/stubs/urllib3/urllib3/__init__.pyi +++ b/stubs/urllib3/urllib3/__init__.pyi @@ -24,5 +24,5 @@ Retry = retry.Retry class NullHandler(logging.Handler): def emit(self, record): ... -def add_stderr_logger(level: int = ...) -> logging.StreamHandler[TextIO]: ... +def add_stderr_logger(level: int = 10) -> logging.StreamHandler[TextIO]: ... def disable_warnings(category: type[Warning] = ...) -> None: ... diff --git a/stubs/urllib3/urllib3/_collections.pyi b/stubs/urllib3/urllib3/_collections.pyi index 630fe616a..e282a9fc0 100644 --- a/stubs/urllib3/urllib3/_collections.pyi +++ b/stubs/urllib3/urllib3/_collections.pyi @@ -15,7 +15,7 @@ class RecentlyUsedContainer(MutableMapping[_KT, _VT]): ContainerCls: Any dispose_func: Any lock: Any - def __init__(self, maxsize=..., dispose_func=...) -> None: ... + def __init__(self, maxsize=10, dispose_func=None) -> None: ... def __getitem__(self, key): ... def __setitem__(self, key, value) -> None: ... def __delitem__(self, key) -> None: ... @@ -25,7 +25,7 @@ class RecentlyUsedContainer(MutableMapping[_KT, _VT]): def keys(self): ... class HTTPHeaderDict(MutableMapping[str, str]): - def __init__(self, headers=..., **kwargs) -> None: ... + def __init__(self, headers=None, **kwargs) -> None: ... def __setitem__(self, key, val) -> None: ... def __getitem__(self, key): ... def __delitem__(self, key) -> None: ... diff --git a/stubs/urllib3/urllib3/connection.pyi b/stubs/urllib3/urllib3/connection.pyi index 8baca880b..51cac4f0a 100644 --- a/stubs/urllib3/urllib3/connection.pyi +++ b/stubs/urllib3/urllib3/connection.pyi @@ -36,7 +36,7 @@ class HTTPSConnection(HTTPConnection): default_port: Any key_file: Any cert_file: Any - def __init__(self, host, port=..., key_file=..., cert_file=..., strict=..., timeout=..., **kw) -> None: ... + def __init__(self, host, port=None, key_file=None, cert_file=None, strict=None, timeout=..., **kw) -> None: ... sock: Any def connect(self): ... @@ -48,7 +48,9 @@ class VerifiedHTTPSConnection(HTTPSConnection): key_file: Any cert_file: Any assert_hostname: Any - def set_cert(self, key_file=..., cert_file=..., cert_reqs=..., ca_certs=..., assert_hostname=..., assert_fingerprint=...): ... + def set_cert( + self, key_file=None, cert_file=None, cert_reqs=None, ca_certs=None, assert_hostname=None, assert_fingerprint=None + ): ... sock: Any auto_open: Any is_verified: Any diff --git a/stubs/urllib3/urllib3/connectionpool.pyi b/stubs/urllib3/urllib3/connectionpool.pyi index 4d27996de..ccb43e307 100644 --- a/stubs/urllib3/urllib3/connectionpool.pyi +++ b/stubs/urllib3/urllib3/connectionpool.pyi @@ -45,7 +45,7 @@ class ConnectionPool: QueueCls: ClassVar[type[queue.Queue[Any]]] host: str port: int | None - def __init__(self, host: str, port: int | None = ...) -> None: ... + def __init__(self, host: str, port: int | None = None) -> None: ... def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None @@ -69,15 +69,15 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods): def __init__( self, host: str, - port: int | None = ..., - strict: bool = ..., + port: int | None = None, + strict: bool = False, timeout: _Timeout = ..., - maxsize: int = ..., - block: bool = ..., - headers: Mapping[str, str] | None = ..., - retries: _Retries | None = ..., - _proxy: Url | None = ..., - _proxy_headers: Mapping[str, str] | None = ..., + maxsize: int = 1, + block: bool = False, + headers: Mapping[str, str] | None = None, + retries: _Retries | None = None, + _proxy: Url | None = None, + _proxy_headers: Mapping[str, str] | None = None, **conn_kw, ) -> None: ... def close(self) -> None: ... @@ -86,14 +86,14 @@ class HTTPConnectionPool(ConnectionPool, RequestMethods): self, method, url, - body=..., - headers=..., - retries=..., - redirect=..., - assert_same_host=..., + body=None, + headers=None, + retries=None, + redirect=True, + assert_same_host=True, timeout=..., - pool_timeout=..., - release_conn=..., + pool_timeout=None, + release_conn=None, **response_kw, ): ... @@ -108,22 +108,22 @@ class HTTPSConnectionPool(HTTPConnectionPool): def __init__( self, host: str, - port: int | None = ..., - strict: bool = ..., + port: int | None = None, + strict: bool = False, timeout: _Timeout = ..., - maxsize: int = ..., - block: bool = ..., - headers: Mapping[str, str] | None = ..., - retries: _Retries | None = ..., - _proxy: Url | None = ..., - _proxy_headers: Mapping[str, str] | None = ..., - key_file: str | None = ..., - cert_file: str | None = ..., - cert_reqs: int | str | None = ..., - ca_certs: str | None = ..., - ssl_version: int | str | None = ..., - assert_hostname: str | Literal[False] | None = ..., - assert_fingerprint: str | None = ..., + maxsize: int = 1, + block: bool = False, + headers: Mapping[str, str] | None = None, + retries: _Retries | None = None, + _proxy: Url | None = None, + _proxy_headers: Mapping[str, str] | None = None, + key_file: str | None = None, + cert_file: str | None = None, + cert_reqs: int | str | None = None, + ca_certs: str | None = None, + ssl_version: int | str | None = None, + assert_hostname: str | Literal[False] | None = None, + assert_fingerprint: str | None = None, **conn_kw, ) -> None: ... diff --git a/stubs/urllib3/urllib3/exceptions.pyi b/stubs/urllib3/urllib3/exceptions.pyi index 8c2090613..f55e8ad93 100644 --- a/stubs/urllib3/urllib3/exceptions.pyi +++ b/stubs/urllib3/urllib3/exceptions.pyi @@ -29,11 +29,11 @@ ConnectionError = ProtocolError class MaxRetryError(RequestError): reason: Exception | None - def __init__(self, pool: ConnectionPool, url: str, reason: Exception | None = ...) -> None: ... + def __init__(self, pool: ConnectionPool, url: str, reason: Exception | None = None) -> None: ... class HostChangedError(RequestError): retries: Retry | int - def __init__(self, pool: ConnectionPool, url: str, retries: Retry | int = ...) -> None: ... + def __init__(self, pool: ConnectionPool, url: str, retries: Retry | int = 3) -> None: ... class TimeoutStateError(HTTPError): ... class TimeoutError(HTTPError): ... diff --git a/stubs/urllib3/urllib3/fields.pyi b/stubs/urllib3/urllib3/fields.pyi index a7eb02554..f2ce965e7 100644 --- a/stubs/urllib3/urllib3/fields.pyi +++ b/stubs/urllib3/urllib3/fields.pyi @@ -5,7 +5,7 @@ from typing_extensions import TypeAlias _FieldValue: TypeAlias = str | bytes _FieldValueTuple: TypeAlias = _FieldValue | tuple[str, _FieldValue] | tuple[str, _FieldValue, str] -def guess_content_type(filename: str | None, default: str = ...) -> str: ... +def guess_content_type(filename: str | None, default: str = "application/octet-stream") -> str: ... def format_header_param_rfc2231(name: str, value: _FieldValue) -> str: ... def format_header_param_html5(name: str, value: _FieldValue) -> str: ... @@ -18,8 +18,8 @@ class RequestField: self, name: str, data: _FieldValue, - filename: str | None = ..., - headers: Mapping[str, str] | None = ..., + filename: str | None = None, + headers: Mapping[str, str] | None = None, header_formatter: Callable[[str, _FieldValue], str] = ..., ) -> None: ... @classmethod @@ -28,5 +28,5 @@ class RequestField: ) -> RequestField: ... def render_headers(self) -> str: ... def make_multipart( - self, content_disposition: str | None = ..., content_type: str | None = ..., content_location: str | None = ... + self, content_disposition: str | None = None, content_type: str | None = None, content_location: str | None = None ) -> None: ... diff --git a/stubs/urllib3/urllib3/filepost.pyi b/stubs/urllib3/urllib3/filepost.pyi index 2780f9070..ee92d1122 100644 --- a/stubs/urllib3/urllib3/filepost.pyi +++ b/stubs/urllib3/urllib3/filepost.pyi @@ -14,4 +14,4 @@ _TYPE_FIELDS: TypeAlias = _TYPE_FIELDS_SEQUENCE | Mapping[str, fields._FieldValu def choose_boundary() -> str: ... def iter_field_objects(fields: _TYPE_FIELDS) -> Iterable[RequestField]: ... def iter_fields(fields): ... -def encode_multipart_formdata(fields: _TYPE_FIELDS, boundary: str | None = ...) -> tuple[bytes, str]: ... +def encode_multipart_formdata(fields: _TYPE_FIELDS, boundary: str | None = None) -> tuple[bytes, str]: ... diff --git a/stubs/urllib3/urllib3/poolmanager.pyi b/stubs/urllib3/urllib3/poolmanager.pyi index ff8df6277..783197af8 100644 --- a/stubs/urllib3/urllib3/poolmanager.pyi +++ b/stubs/urllib3/urllib3/poolmanager.pyi @@ -8,13 +8,13 @@ class PoolManager(RequestMethods): proxy: Any connection_pool_kw: Any pools: Any - def __init__(self, num_pools=..., headers=..., **connection_pool_kw) -> None: ... + def __init__(self, num_pools=10, headers=None, **connection_pool_kw) -> None: ... def __enter__(self): ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> Literal[False]: ... def clear(self): ... - def connection_from_host(self, host, port=..., scheme=...): ... + def connection_from_host(self, host, port=None, scheme="http"): ... def connection_from_url(self, url): ... # TODO: This was the original signature -- copied another one from base class to fix complaint. # def urlopen(self, method, url, redirect=True, **kw): ... @@ -23,8 +23,8 @@ class PoolManager(RequestMethods): class ProxyManager(PoolManager): proxy: Any proxy_headers: Any - def __init__(self, proxy_url, num_pools=..., headers=..., proxy_headers=..., **connection_pool_kw) -> None: ... - def connection_from_host(self, host, port=..., scheme=...): ... + def __init__(self, proxy_url, num_pools=10, headers=None, proxy_headers=None, **connection_pool_kw) -> None: ... + def connection_from_host(self, host, port=None, scheme="http"): ... # TODO: This was the original signature -- copied another one from base class to fix complaint. # def urlopen(self, method, url, redirect=True, **kw): ... def urlopen(self, method, url, body=..., headers=..., encode_multipart=..., multipart_boundary=..., **kw): ... diff --git a/stubs/urllib3/urllib3/request.pyi b/stubs/urllib3/urllib3/request.pyi index b95ab295b..e9b14e225 100644 --- a/stubs/urllib3/urllib3/request.pyi +++ b/stubs/urllib3/urllib3/request.pyi @@ -2,10 +2,10 @@ from typing import Any class RequestMethods: headers: Any - def __init__(self, headers=...) -> None: ... - def urlopen(self, method, url, body=..., headers=..., encode_multipart=..., multipart_boundary=..., **kw): ... - def request(self, method, url, fields=..., headers=..., **urlopen_kw): ... - def request_encode_url(self, method, url, fields=..., **urlopen_kw): ... + def __init__(self, headers=None) -> None: ... + def urlopen(self, method, url, body=None, headers=None, encode_multipart=True, multipart_boundary=None, **kw): ... + def request(self, method, url, fields=None, headers=None, **urlopen_kw): ... + def request_encode_url(self, method, url, fields=None, **urlopen_kw): ... def request_encode_body( - self, method, url, fields=..., headers=..., encode_multipart=..., multipart_boundary=..., **urlopen_kw + self, method, url, fields=None, headers=None, encode_multipart=True, multipart_boundary=None, **urlopen_kw ): ... diff --git a/stubs/urllib3/urllib3/response.pyi b/stubs/urllib3/urllib3/response.pyi index a4f76d312..ee28d2c01 100644 --- a/stubs/urllib3/urllib3/response.pyi +++ b/stubs/urllib3/urllib3/response.pyi @@ -52,23 +52,23 @@ class HTTPResponse(io.IOBase): length_remaining: int | None def __init__( self, - body: _TYPE_BODY = ..., - headers: Mapping[str, str] | Mapping[bytes, bytes] | None = ..., - status: int = ..., - version: int = ..., - reason: str | None = ..., - strict: int = ..., - preload_content: bool = ..., - decode_content: bool = ..., - original_response: _HttplibHTTPResponse | None = ..., - pool: HTTPConnectionPool | None = ..., - connection: HTTPConnection | None = ..., - msg: _HttplibHTTPMessage | None = ..., - retries: Retry | None = ..., - enforce_content_length: bool = ..., - request_method: str | None = ..., - request_url: str | None = ..., - auto_close: bool = ..., + body: _TYPE_BODY = "", + headers: Mapping[str, str] | Mapping[bytes, bytes] | None = None, + status: int = 0, + version: int = 0, + reason: str | None = None, + strict: int = 0, + preload_content: bool = True, + decode_content: bool = True, + original_response: _HttplibHTTPResponse | None = None, + pool: HTTPConnectionPool | None = None, + connection: HTTPConnection | None = None, + msg: _HttplibHTTPMessage | None = None, + retries: Retry | None = None, + enforce_content_length: bool = False, + request_method: str | None = None, + request_url: str | None = None, + auto_close: bool = True, ) -> None: ... def get_redirect_location(self) -> Literal[False] | str | None: ... def release_conn(self) -> None: ... @@ -79,12 +79,12 @@ class HTTPResponse(io.IOBase): def connection(self) -> HTTPConnection | Any: ... def isclosed(self) -> bool: ... def tell(self) -> int: ... - def read(self, amt: int | None = ..., decode_content: bool | None = ..., cache_content: bool = ...) -> bytes: ... - def stream(self, amt: int | None = ..., decode_content: bool | None = ...) -> Iterator[bytes]: ... + def read(self, amt: int | None = None, decode_content: bool | None = None, cache_content: bool = False) -> bytes: ... + def stream(self, amt: int | None = 65536, decode_content: bool | None = None) -> Iterator[bytes]: ... @classmethod def from_httplib(cls, r: _HttplibHTTPResponse, **response_kw: Any) -> Self: ... def getheaders(self) -> HTTPHeaderDict: ... - def getheader(self, name, default=...) -> str | None: ... + def getheader(self, name, default=None) -> str | None: ... def info(self) -> HTTPHeaderDict: ... def close(self) -> None: ... @property @@ -94,5 +94,5 @@ class HTTPResponse(io.IOBase): def readable(self) -> bool: ... def readinto(self, b: bytearray) -> int: ... def supports_chunked_reads(self) -> bool: ... - def read_chunked(self, amt: int | None = ..., decode_content: bool | None = ...) -> Iterator[bytes]: ... + def read_chunked(self, amt: int | None = None, decode_content: bool | None = None) -> Iterator[bytes]: ... def geturl(self) -> str | None: ... diff --git a/stubs/urllib3/urllib3/util/connection.pyi b/stubs/urllib3/urllib3/util/connection.pyi index db77bd009..8d2e6c296 100644 --- a/stubs/urllib3/urllib3/util/connection.pyi +++ b/stubs/urllib3/urllib3/util/connection.pyi @@ -5,4 +5,4 @@ select: Any HAS_IPV6: bool def is_connection_dropped(conn): ... -def create_connection(address, timeout=..., source_address=..., socket_options=...): ... +def create_connection(address, timeout=..., source_address=None, socket_options=None): ... diff --git a/stubs/urllib3/urllib3/util/request.pyi b/stubs/urllib3/urllib3/util/request.pyi index f770cd9fa..a2f227120 100644 --- a/stubs/urllib3/urllib3/util/request.pyi +++ b/stubs/urllib3/urllib3/util/request.pyi @@ -7,5 +7,5 @@ from typing import Any ACCEPT_ENCODING: Any def make_headers( - keep_alive=..., accept_encoding=..., user_agent=..., basic_auth=..., proxy_basic_auth=..., disable_cache=... + keep_alive=None, accept_encoding=None, user_agent=None, basic_auth=None, proxy_basic_auth=None, disable_cache=None ): ... diff --git a/stubs/urllib3/urllib3/util/retry.pyi b/stubs/urllib3/urllib3/util/retry.pyi index 8fdb97685..d0f9cfe83 100644 --- a/stubs/urllib3/urllib3/util/retry.pyi +++ b/stubs/urllib3/urllib3/util/retry.pyi @@ -45,40 +45,40 @@ class Retry: remove_headers_on_redirect: frozenset[str] def __init__( self, - total: bool | int | None = ..., - connect: int | None = ..., - read: int | None = ..., - redirect: bool | int | None = ..., - status: int | None = ..., - other: int | None = ..., + total: bool | int | None = 10, + connect: int | None = None, + read: int | None = None, + redirect: bool | int | None = None, + status: int | None = None, + other: int | None = None, allowed_methods: Collection[str] | Literal[False] | None = ..., - status_forcelist: Collection[int] | None = ..., - backoff_factor: float = ..., - raise_on_redirect: bool = ..., - raise_on_status: bool = ..., - history: tuple[RequestHistory, ...] | None = ..., - respect_retry_after_header: bool = ..., + status_forcelist: Collection[int] | None = None, + backoff_factor: float = 0, + raise_on_redirect: bool = True, + raise_on_status: bool = True, + history: tuple[RequestHistory, ...] | None = None, + respect_retry_after_header: bool = True, remove_headers_on_redirect: Collection[str] = ..., method_whitelist: Collection[str] | None = ..., ) -> None: ... def new(self, **kw: Any) -> Self: ... @classmethod def from_int( - cls, retries: Retry | bool | int | None, redirect: bool | int | None = ..., default: Retry | bool | int | None = ... + cls, retries: Retry | bool | int | None, redirect: bool | int | None = True, default: Retry | bool | int | None = None ) -> Retry: ... def get_backoff_time(self) -> float: ... def parse_retry_after(self, retry_after: str) -> float: ... def get_retry_after(self, response: HTTPResponse) -> float | None: ... - def sleep_for_retry(self, response: HTTPResponse | None = ...) -> bool: ... - def sleep(self, response: HTTPResponse | None = ...) -> None: ... - def is_retry(self, method: str, status_code: int, has_retry_after: bool = ...) -> bool: ... + def sleep_for_retry(self, response: HTTPResponse | None = None) -> bool: ... + def sleep(self, response: HTTPResponse | None = None) -> None: ... + def is_retry(self, method: str, status_code: int, has_retry_after: bool = False) -> bool: ... def is_exhausted(self) -> bool: ... def increment( self, - method: str | None = ..., - url: str | None = ..., - response: HTTPResponse | None = ..., - error: Exception | None = ..., - _pool: ConnectionPool | None = ..., - _stacktrace: TracebackType | None = ..., + method: str | None = None, + url: str | None = None, + response: HTTPResponse | None = None, + error: Exception | None = None, + _pool: ConnectionPool | None = None, + _stacktrace: TracebackType | None = None, ) -> Retry: ... diff --git a/stubs/urllib3/urllib3/util/ssl_.pyi b/stubs/urllib3/urllib3/util/ssl_.pyi index 3a3c53928..999d3a336 100644 --- a/stubs/urllib3/urllib3/util/ssl_.pyi +++ b/stubs/urllib3/urllib3/util/ssl_.pyi @@ -17,15 +17,15 @@ DEFAULT_CIPHERS: str def assert_fingerprint(cert, fingerprint): ... def resolve_cert_reqs(candidate): ... def resolve_ssl_version(candidate): ... -def create_urllib3_context(ssl_version=..., cert_reqs=..., options=..., ciphers=...): ... +def create_urllib3_context(ssl_version=None, cert_reqs=None, options=None, ciphers=None): ... def ssl_wrap_socket( sock, - keyfile=..., - certfile=..., - cert_reqs=..., - ca_certs=..., - server_hostname=..., - ssl_version=..., - ciphers=..., - ssl_context=..., + keyfile=None, + certfile=None, + cert_reqs=None, + ca_certs=None, + server_hostname=None, + ssl_version=None, + ciphers=None, + ssl_context=None, ): ... diff --git a/stubs/urllib3/urllib3/util/timeout.pyi b/stubs/urllib3/urllib3/util/timeout.pyi index 25879d685..e9f2aad72 100644 --- a/stubs/urllib3/urllib3/util/timeout.pyi +++ b/stubs/urllib3/urllib3/util/timeout.pyi @@ -9,7 +9,7 @@ def current_time(): ... class Timeout: DEFAULT_TIMEOUT: Any total: Any - def __init__(self, total=..., connect=..., read=...) -> None: ... + def __init__(self, total=None, connect=..., read=...) -> None: ... @classmethod def from_float(cls, timeout): ... def clone(self): ... diff --git a/stubs/urllib3/urllib3/util/url.pyi b/stubs/urllib3/urllib3/util/url.pyi index fe98d2a1c..678f09869 100644 --- a/stubs/urllib3/urllib3/util/url.pyi +++ b/stubs/urllib3/urllib3/util/url.pyi @@ -18,13 +18,13 @@ class _UrlBase(NamedTuple): class Url(_UrlBase): def __new__( cls, - scheme: str | None = ..., - auth: str | None = ..., - host: str | None = ..., - port: int | None = ..., - path: str | None = ..., - query: str | None = ..., - fragment: str | None = ..., + scheme: str | None = None, + auth: str | None = None, + host: str | None = None, + port: int | None = None, + path: str | None = None, + query: str | None = None, + fragment: str | None = None, ): ... @property def hostname(self) -> str | None: ... diff --git a/stubs/vobject/vobject/base.pyi b/stubs/vobject/vobject/base.pyi index 138794c44..556f5e727 100644 --- a/stubs/vobject/vobject/base.pyi +++ b/stubs/vobject/vobject/base.pyi @@ -21,25 +21,25 @@ class VBase: behavior: Incomplete | None parentBehavior: Incomplete | None isNative: bool - def __init__(self, group: Incomplete | None = ...) -> None: ... + def __init__(self, group: Incomplete | None = None) -> None: ... def copy(self, copyit: VBase) -> None: ... def validate(self, *args, **kwds) -> bool: ... def getChildren(self) -> list[Any]: ... - def clearBehavior(self, cascade: bool = ...) -> None: ... - def autoBehavior(self, cascade: bool = ...) -> None: ... - def setBehavior(self, behavior, cascade: bool = ...) -> None: ... + def clearBehavior(self, cascade: bool = True) -> None: ... + def autoBehavior(self, cascade: bool = False) -> None: ... + def setBehavior(self, behavior, cascade: bool = True) -> None: ... def transformToNative(self): ... def transformFromNative(self): ... def transformChildrenToNative(self) -> None: ... - def transformChildrenFromNative(self, clearBehavior: bool = ...) -> None: ... + def transformChildrenFromNative(self, clearBehavior: bool = True) -> None: ... @overload def serialize( - self, buf: None = ..., lineLength: int = ..., validate: bool = ..., behavior: Incomplete | None = ... + self, buf: None = None, lineLength: int = 75, validate: bool = True, behavior: Incomplete | None = None ) -> str: ... @overload - def serialize(self, buf: _W, lineLength: int = ..., validate: bool = ..., behavior: Incomplete | None = ...) -> _W: ... + def serialize(self, buf: _W, lineLength: int = 75, validate: bool = True, behavior: Incomplete | None = None) -> _W: ... -def toVName(name, stripNum: int = ..., upper: bool = ...): ... +def toVName(name, stripNum: int = 0, upper: bool = False): ... class ContentLine(VBase): name: Any @@ -54,10 +54,10 @@ class ContentLine(VBase): name, params, value, - group: Incomplete | None = ..., - encoded: bool = ..., - isNative: bool = ..., - lineNumber: Incomplete | None = ..., + group: Incomplete | None = None, + encoded: bool = False, + isNative: bool = False, + lineNumber: Incomplete | None = None, *args, **kwds, ) -> None: ... @@ -70,13 +70,13 @@ class ContentLine(VBase): def __delattr__(self, name: str) -> None: ... def valueRepr(self): ... def __unicode__(self) -> str: ... - def prettyPrint(self, level: int = ..., tabwidth: int = ...) -> None: ... + def prettyPrint(self, level: int = 0, tabwidth: int = 3) -> None: ... class Component(VBase): contents: dict[str, list[VBase]] name: Any useBegin: bool - def __init__(self, name: Incomplete | None = ..., *args, **kwds) -> None: ... + def __init__(self, name: Incomplete | None = None, *args, **kwds) -> None: ... @classmethod def duplicate(cls, copyit): ... def copy(self, copyit) -> None: ... @@ -85,17 +85,17 @@ class Component(VBase): normal_attributes: Any def __setattr__(self, name: str, value) -> None: ... def __delattr__(self, name: str) -> None: ... - def getChildValue(self, childName, default: Incomplete | None = ..., childNumber: int = ...): ... + def getChildValue(self, childName, default: Incomplete | None = None, childNumber: int = 0): ... @overload - def add(self, objOrName: _V, group: str | None = ...) -> _V: ... + def add(self, objOrName: _V, group: str | None = None) -> _V: ... @overload - def add(self, objOrName: Literal["vevent"], group: str | None = ...) -> Component: ... + def add(self, objOrName: Literal["vevent"], group: str | None = None) -> Component: ... @overload def add( - self, objOrName: Literal["uid", "summary", "description", "dtstart", "dtend"], group: str | None = ... + self, objOrName: Literal["uid", "summary", "description", "dtstart", "dtend"], group: str | None = None ) -> ContentLine: ... @overload - def add(self, objOrName: str, group: str | None = ...) -> Any: ... # returns VBase sub-class + def add(self, objOrName: str, group: str | None = None) -> Any: ... # returns VBase sub-class def remove(self, obj) -> None: ... def getChildren(self) -> list[Any]: ... def components(self) -> Iterable[Component]: ... @@ -104,13 +104,13 @@ class Component(VBase): def getSortedChildren(self): ... def setBehaviorFromVersionLine(self, versionLine) -> None: ... def transformChildrenToNative(self) -> None: ... - def transformChildrenFromNative(self, clearBehavior: bool = ...) -> None: ... - def prettyPrint(self, level: int = ..., tabwidth: int = ...) -> None: ... + def transformChildrenFromNative(self, clearBehavior: bool = True) -> None: ... + def prettyPrint(self, level: int = 0, tabwidth: int = 3) -> None: ... class VObjectError(Exception): msg: Any lineNumber: Any - def __init__(self, msg, lineNumber: Incomplete | None = ...) -> None: ... + def __init__(self, msg, lineNumber: Incomplete | None = None) -> None: ... class ParseError(VObjectError): ... class ValidateError(VObjectError): ... @@ -123,16 +123,16 @@ line_re: Any begin_re: Any def parseParams(string): ... -def parseLine(line, lineNumber: Incomplete | None = ...): ... +def parseLine(line, lineNumber: Incomplete | None = None): ... wrap_re: Any logical_lines_re: Any testLines: str -def getLogicalLines(fp, allowQP: bool = ...) -> None: ... -def textLineToContentLine(text, n: Incomplete | None = ...): ... +def getLogicalLines(fp, allowQP: bool = True) -> None: ... +def textLineToContentLine(text, n: Incomplete | None = None): ... def dquoteEscape(param): ... -def foldOneLine(outbuf, input, lineLength: int = ...) -> None: ... +def foldOneLine(outbuf, input, lineLength: int = 75) -> None: ... def defaultSerialize(obj, buf, lineLength): ... class Stack: @@ -145,10 +145,10 @@ class Stack: def pop(self): ... def readComponents( - streamOrString, validate: bool = ..., transform: bool = ..., ignoreUnreadable: bool = ..., allowQP: bool = ... + streamOrString, validate: bool = False, transform: bool = True, ignoreUnreadable: bool = False, allowQP: bool = False ) -> Iterator[Component]: ... -def readOne(stream, validate: bool = ..., transform: bool = ..., ignoreUnreadable: bool = ..., allowQP: bool = ...): ... -def registerBehavior(behavior, name: Incomplete | None = ..., default: bool = ..., id: Incomplete | None = ...) -> None: ... -def getBehavior(name, id: Incomplete | None = ...): ... -def newFromBehavior(name, id: Incomplete | None = ...): ... +def readOne(stream, validate: bool = False, transform: bool = True, ignoreUnreadable: bool = False, allowQP: bool = False): ... +def registerBehavior(behavior, name: Incomplete | None = None, default: bool = False, id: Incomplete | None = None) -> None: ... +def getBehavior(name, id: Incomplete | None = None): ... +def newFromBehavior(name, id: Incomplete | None = None): ... def backslashEscape(s): ... diff --git a/stubs/vobject/vobject/behavior.pyi b/stubs/vobject/vobject/behavior.pyi index 9c6e5a6ec..72f371ad3 100644 --- a/stubs/vobject/vobject/behavior.pyi +++ b/stubs/vobject/vobject/behavior.pyi @@ -13,7 +13,7 @@ class Behavior: forceUTC: bool sortFirst: Any @classmethod - def validate(cls, obj, raiseException: bool = ..., complainUnrecognized: bool = ...): ... + def validate(cls, obj, raiseException: bool = False, complainUnrecognized: bool = False): ... @classmethod def lineValidate(cls, line, raiseException, complainUnrecognized): ... @classmethod @@ -27,6 +27,6 @@ class Behavior: @classmethod def generateImplicitParameters(cls, obj) -> None: ... @classmethod - def serialize(cls, obj, buf, lineLength, validate: bool = ...): ... + def serialize(cls, obj, buf, lineLength, validate: bool = True): ... @classmethod def valueRepr(cls, line): ... diff --git a/stubs/vobject/vobject/change_tz.pyi b/stubs/vobject/vobject/change_tz.pyi index ed4de7b2b..18915bb3d 100644 --- a/stubs/vobject/vobject/change_tz.pyi +++ b/stubs/vobject/vobject/change_tz.pyi @@ -1,4 +1,4 @@ -def change_tz(cal, new_timezone, default, utc_only: bool = ..., utc_tz=...) -> None: ... +def change_tz(cal, new_timezone, default, utc_only: bool = False, utc_tz=...) -> None: ... def main() -> None: ... version: str diff --git a/stubs/vobject/vobject/hcalendar.pyi b/stubs/vobject/vobject/hcalendar.pyi index 0c29d239d..bbebf71bd 100644 --- a/stubs/vobject/vobject/hcalendar.pyi +++ b/stubs/vobject/vobject/hcalendar.pyi @@ -5,4 +5,4 @@ from .icalendar import VCalendar2_0 class HCalendar(VCalendar2_0): name: str @classmethod - def serialize(cls, obj, buf: Incomplete | None = ..., lineLength: Incomplete | None = ..., validate: bool = ...): ... + def serialize(cls, obj, buf: Incomplete | None = None, lineLength: Incomplete | None = None, validate: bool = True): ... diff --git a/stubs/vobject/vobject/icalendar.pyi b/stubs/vobject/vobject/icalendar.pyi index ecfe79a18..75dff2e52 100644 --- a/stubs/vobject/vobject/icalendar.pyi +++ b/stubs/vobject/vobject/icalendar.pyi @@ -16,7 +16,7 @@ twoHours: timedelta def toUnicode(s: str | bytes) -> str: ... def registerTzid(tzid, tzinfo) -> None: ... -def getTzid(tzid, smart: bool = ...): ... +def getTzid(tzid, smart: bool = True): ... utc: Any # dateutil.tz.tz.tzutc @@ -26,23 +26,23 @@ class TimezoneComponent(Component): tzinfo: Any name: str useBegin: bool - def __init__(self, tzinfo: Incomplete | None = ..., *args, **kwds) -> None: ... + def __init__(self, tzinfo: Incomplete | None = None, *args, **kwds) -> None: ... @classmethod def registerTzinfo(cls, tzinfo): ... def gettzinfo(self): ... tzid: Any daylight: Any standard: Any - def settzinfo(self, tzinfo, start: int = ..., end: int = ...): ... + def settzinfo(self, tzinfo, start: int = 2000, end: int = 2030): ... normal_attributes: Any @staticmethod - def pickTzid(tzinfo, allowUTC: bool = ...): ... + def pickTzid(tzinfo, allowUTC: bool = False): ... def prettyPrint(self, level, tabwidth) -> None: ... # type: ignore[override] class RecurringComponent(Component): isNative: bool def __init__(self, *args, **kwds) -> None: ... - def getrruleset(self, addRDate: bool = ...): ... + def getrruleset(self, addRDate: bool = False): ... def setrruleset(self, rruleset): ... rruleset: Any def __setattr__(self, name, value) -> None: ... @@ -110,7 +110,7 @@ class VCalendar2_0(VCalendarComponentBehavior): @classmethod def generateImplicitParameters(cls, obj) -> None: ... @classmethod - def serialize(cls, obj, buf, lineLength, validate: bool = ...): ... + def serialize(cls, obj, buf, lineLength, validate: bool = True): ... class VTimezone(VCalendarComponentBehavior): name: str @@ -220,18 +220,18 @@ def numToDigits(num, places): ... def timedeltaToString(delta): ... def timeToString(dateOrDateTime): ... def dateToString(date): ... -def dateTimeToString(dateTime, convertToUTC: bool = ...): ... +def dateTimeToString(dateTime, convertToUTC: bool = False): ... def deltaToOffset(delta): ... -def periodToString(period, convertToUTC: bool = ...): ... +def periodToString(period, convertToUTC: bool = False): ... def isDuration(s): ... def stringToDate(s): ... -def stringToDateTime(s, tzinfo: Incomplete | None = ...): ... +def stringToDateTime(s, tzinfo: Incomplete | None = None): ... escapableCharList: str -def stringToTextValues(s, listSeparator: str = ..., charList: Incomplete | None = ..., strict: bool = ...): ... -def stringToDurations(s, strict: bool = ...): ... -def parseDtstart(contentline, allowSignatureMismatch: bool = ...): ... -def stringToPeriod(s, tzinfo: Incomplete | None = ...): ... +def stringToTextValues(s, listSeparator: str = ",", charList: Incomplete | None = None, strict: bool = False): ... +def stringToDurations(s, strict: bool = False): ... +def parseDtstart(contentline, allowSignatureMismatch: bool = False): ... +def stringToPeriod(s, tzinfo: Incomplete | None = None): ... def getTransition(transitionTo, year, tzinfo): ... -def tzinfo_eq(tzinfo1, tzinfo2, startYear: int = ..., endYear: int = ...): ... +def tzinfo_eq(tzinfo1, tzinfo2, startYear: int = 2000, endYear: int = 2020): ... diff --git a/stubs/vobject/vobject/ics_diff.pyi b/stubs/vobject/vobject/ics_diff.pyi index b115a461a..7da018df9 100644 --- a/stubs/vobject/vobject/ics_diff.pyi +++ b/stubs/vobject/vobject/ics_diff.pyi @@ -1,6 +1,6 @@ def getSortKey(component): ... def sortByUID(components): ... -def deleteExtraneous(component, ignore_dtstamp: bool = ...) -> None: ... +def deleteExtraneous(component, ignore_dtstamp: bool = False) -> None: ... def diff(left, right): ... def prettyDiff(leftObj, rightObj) -> None: ... def main() -> None: ... diff --git a/stubs/vobject/vobject/vcard.pyi b/stubs/vobject/vobject/vcard.pyi index 54bdc9bed..0af7e3c75 100644 --- a/stubs/vobject/vobject/vcard.pyi +++ b/stubs/vobject/vobject/vcard.pyi @@ -9,9 +9,7 @@ class Name: additional: Any prefix: Any suffix: Any - def __init__( - self, family: str = ..., given: str = ..., additional: str = ..., prefix: str = ..., suffix: str = ... - ) -> None: ... + def __init__(self, family: str = "", given: str = "", additional: str = "", prefix: str = "", suffix: str = "") -> None: ... @staticmethod def toString(val): ... def __eq__(self, other): ... @@ -26,16 +24,16 @@ class Address: country: Any def __init__( self, - street: str = ..., - city: str = ..., - region: str = ..., - code: str = ..., - country: str = ..., - box: str = ..., - extended: str = ..., + street: str = "", + city: str = "", + region: str = "", + code: str = "", + country: str = "", + box: str = "", + extended: str = "", ) -> None: ... @staticmethod - def toString(val, join_char: str = ...): ... + def toString(val, join_char: str = "\n"): ... lines: Any one_line: Any def __eq__(self, other): ... @@ -84,7 +82,7 @@ class Photo(VCardTextBehavior): def toListOrString(string): ... def splitFields(string): ... def toList(stringOrList): ... -def serializeFields(obj, order: Incomplete | None = ...): ... +def serializeFields(obj, order: Incomplete | None = None): ... NAME_ORDER: Any ADDRESS_ORDER: Any diff --git a/stubs/waitress/waitress/buffers.pyi b/stubs/waitress/waitress/buffers.pyi index 0babddaef..aaa4d4468 100644 --- a/stubs/waitress/waitress/buffers.pyi +++ b/stubs/waitress/waitress/buffers.pyi @@ -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: ... diff --git a/stubs/waitress/waitress/channel.pyi b/stubs/waitress/waitress/channel.pyi index d14dff869..1d6d6b09a 100644 --- a/stubs/waitress/waitress/channel.pyi +++ b/stubs/waitress/waitress/channel.pyi @@ -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: ... diff --git a/stubs/waitress/waitress/proxy_headers.pyi b/stubs/waitress/waitress/proxy_headers.pyi index d5b774539..bc0f20ef6 100644 --- a/stubs/waitress/waitress/proxy_headers.pyi +++ b/stubs/waitress/waitress/proxy_headers.pyi @@ -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: ... diff --git a/stubs/waitress/waitress/runner.pyi b/stubs/waitress/waitress/runner.pyi index aeced93f4..c716ee7e1 100644 --- a/stubs/waitress/waitress/runner.pyi +++ b/stubs/waitress/waitress/runner.pyi @@ -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: ... diff --git a/stubs/waitress/waitress/server.pyi b/stubs/waitress/waitress/server.pyi index ada4b1b22..1b6546b22 100644 --- a/stubs/waitress/waitress/server.pyi +++ b/stubs/waitress/waitress/server.pyi @@ -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: ... diff --git a/stubs/waitress/waitress/task.pyi b/stubs/waitress/waitress/task.pyi index 1f33f1891..afb9cd34a 100644 --- a/stubs/waitress/waitress/task.pyi +++ b/stubs/waitress/waitress/task.pyi @@ -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 = ... diff --git a/stubs/waitress/waitress/trigger.pyi b/stubs/waitress/waitress/trigger.pyi index 45d1a40dc..29d785fc3 100644 --- a/stubs/waitress/waitress/trigger.pyi +++ b/stubs/waitress/waitress/trigger.pyi @@ -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": diff --git a/stubs/waitress/waitress/utilities.pyi b/stubs/waitress/waitress/utilities.pyi index cf3d44caf..621a02aa7 100644 --- a/stubs/waitress/waitress/utilities.pyi +++ b/stubs/waitress/waitress/utilities.pyi @@ -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] diff --git a/stubs/waitress/waitress/wasyncore.pyi b/stubs/waitress/waitress/wasyncore.pyi index 0125447f3..f2e178dab 100644 --- a/stubs/waitress/waitress/wasyncore.pyi +++ b/stubs/waitress/waitress/wasyncore.pyi @@ -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: diff --git a/stubs/whatthepatch/whatthepatch/apply.pyi b/stubs/whatthepatch/whatthepatch/apply.pyi index c927a4cef..cff926bc2 100644 --- a/stubs/whatthepatch/whatthepatch/apply.pyi +++ b/stubs/whatthepatch/whatthepatch/apply.pyi @@ -5,4 +5,4 @@ from .exceptions import HunkApplyException as HunkApplyException, SubprocessExce from .snippets import remove as remove, which as which def apply_patch(diffs: patch.diffobj | Iterable[patch.diffobj]) -> None: ... -def apply_diff(diff: patch.diffobj, text: str | Iterable[str], reverse: bool = ..., use_patch: bool = ...) -> list[str]: ... +def apply_diff(diff: patch.diffobj, text: str | Iterable[str], reverse: bool = False, use_patch: bool = False) -> list[str]: ... diff --git a/stubs/whatthepatch/whatthepatch/exceptions.pyi b/stubs/whatthepatch/whatthepatch/exceptions.pyi index 918275ea2..b37de75f8 100644 --- a/stubs/whatthepatch/whatthepatch/exceptions.pyi +++ b/stubs/whatthepatch/whatthepatch/exceptions.pyi @@ -2,7 +2,7 @@ class WhatThePatchException(Exception): ... class HunkException(WhatThePatchException): hunk: int | None - def __init__(self, msg: str, hunk: int | None = ...) -> None: ... + def __init__(self, msg: str, hunk: int | None = None) -> None: ... class ApplyException(WhatThePatchException): ... diff --git a/stubs/zxcvbn/zxcvbn/__init__.pyi b/stubs/zxcvbn/zxcvbn/__init__.pyi index f363552bd..e2872e1f9 100644 --- a/stubs/zxcvbn/zxcvbn/__init__.pyi +++ b/stubs/zxcvbn/zxcvbn/__init__.pyi @@ -15,4 +15,4 @@ class _Result(_TimeEstimate, TypedDict): calc_time: datetime.timedelta feedback: _Feedback -def zxcvbn(password: str, user_inputs: Iterable[object] | None = ...) -> _Result: ... +def zxcvbn(password: str, user_inputs: Iterable[object] | None = None) -> _Result: ... diff --git a/stubs/zxcvbn/zxcvbn/scoring.pyi b/stubs/zxcvbn/zxcvbn/scoring.pyi index 1d7d7be05..fff6a6a56 100644 --- a/stubs/zxcvbn/zxcvbn/scoring.pyi +++ b/stubs/zxcvbn/zxcvbn/scoring.pyi @@ -22,7 +22,9 @@ class _GuessesResult(TypedDict): sequence: list[_Match] def nCk(n: int, k: int) -> float: ... -def most_guessable_match_sequence(password: str, matches: Iterable[_Match], _exclude_additive: bool = ...) -> _GuessesResult: ... +def most_guessable_match_sequence( + password: str, matches: Iterable[_Match], _exclude_additive: bool = False +) -> _GuessesResult: ... def estimate_guesses(match: _Match, password: str) -> Decimal: ... def bruteforce_guesses(match: _Match) -> int: ... def dictionary_guesses(match: _Match) -> int: ...