diff --git a/stubs/D3DShot/d3dshot/capture_outputs/pil_capture_output.pyi b/stubs/D3DShot/d3dshot/capture_outputs/pil_capture_output.pyi index 0a593d73357d..d1e2c87822f2 100644 --- a/stubs/D3DShot/d3dshot/capture_outputs/pil_capture_output.pyi +++ b/stubs/D3DShot/d3dshot/capture_outputs/pil_capture_output.pyi @@ -1,12 +1,11 @@ +from _typeshed import Unused from collections.abc import Sequence from ctypes import _CVoidConstPLike from typing import TypeVar -from typing_extensions import TypeAlias from d3dshot.capture_output import CaptureOutput from PIL import Image -_Unused: TypeAlias = object _ImageT = TypeVar("_ImageT", bound=Image.Image) class PILCaptureOutput(CaptureOutput): @@ -22,4 +21,4 @@ class PILCaptureOutput(CaptureOutput): rotation: int, ) -> Image.Image: ... def to_pil(self, frame: _ImageT) -> _ImageT: ... - def stack(self, frames: Sequence[_ImageT], stack_dimension: _Unused) -> Sequence[_ImageT]: ... + def stack(self, frames: Sequence[_ImageT], stack_dimension: Unused) -> Sequence[_ImageT]: ... diff --git a/stubs/Pillow/PIL/PSDraw.pyi b/stubs/Pillow/PIL/PSDraw.pyi index 2386f284a980..d25d1cba672c 100644 --- a/stubs/Pillow/PIL/PSDraw.pyi +++ b/stubs/Pillow/PIL/PSDraw.pyi @@ -1,4 +1,4 @@ -from _typeshed import SupportsWrite +from _typeshed import SupportsWrite, Unused from .Image import Image @@ -6,7 +6,7 @@ class PSDraw: fp: SupportsWrite[bytes] def __init__(self, fp: SupportsWrite[bytes] | None = ...) -> None: ... isofont: dict[bytes, int] - def begin_document(self, id: object | None = ...) -> None: ... + def begin_document(self, id: Unused = None) -> None: ... def end_document(self) -> None: ... def setfont(self, font: str, size: int) -> None: ... def line(self, xy0: tuple[int, int], xy1: tuple[int, int]) -> None: ... diff --git a/stubs/PyMySQL/pymysql/converters.pyi b/stubs/PyMySQL/pymysql/converters.pyi index 850ca799d8db..6ce9f25ebc85 100644 --- a/stubs/PyMySQL/pymysql/converters.pyi +++ b/stubs/PyMySQL/pymysql/converters.pyi @@ -1,5 +1,6 @@ import datetime import time +from _typeshed import Unused from collections.abc import Callable, Mapping, Sequence from decimal import Decimal from typing import Any, TypeVar @@ -25,7 +26,7 @@ def escape_time(obj: datetime.time, mapping: _EscaperMapping = ...) -> str: ... def escape_datetime(obj: datetime.datetime, mapping: _EscaperMapping = ...) -> str: ... def escape_date(obj: datetime.date, mapping: _EscaperMapping = ...) -> str: ... def escape_struct_time(obj: time.struct_time, mapping: _EscaperMapping = ...) -> str: ... -def Decimal2Literal(o: Decimal, d: object) -> str: ... +def Decimal2Literal(o: Decimal, d: Unused) -> str: ... def convert_datetime(obj: str | bytes) -> datetime.datetime | str: ... def convert_timedelta(obj: str | bytes) -> datetime.timedelta | str: ... def convert_time(obj: str | bytes) -> datetime.time | str: ... diff --git a/stubs/PyScreeze/pyscreeze/__init__.pyi b/stubs/PyScreeze/pyscreeze/__init__.pyi index c62c94fe69e6..5c52490e9b55 100644 --- a/stubs/PyScreeze/pyscreeze/__init__.pyi +++ b/stubs/PyScreeze/pyscreeze/__init__.pyi @@ -1,11 +1,10 @@ -from _typeshed import Incomplete, StrOrBytesPath +from _typeshed import Incomplete, StrOrBytesPath, Unused from collections.abc import Callable, Generator from typing import NamedTuple, SupportsFloat, TypeVar, overload from typing_extensions import Final, ParamSpec, SupportsIndex, TypeAlias from PIL import Image -_Unused: TypeAlias = object _P = ParamSpec("_P") _R = TypeVar("_R") # TODO: cv2.Mat is not available as a type yet: @@ -49,7 +48,7 @@ def locate( haystackImage: str | Image.Image | _Mat, *, grayscale: bool | None = None, - limit: _Unused = 1, + limit: Unused = 1, region: tuple[int, int, int, int] | None = None, step: int = 1, confidence: SupportsFloat | SupportsIndex | str = 0.999, @@ -62,7 +61,7 @@ def locate( haystackImage: str | Image.Image, *, grayscale: bool | None = None, - limit: _Unused = 1, + limit: Unused = 1, region: tuple[int, int, int, int] | None = None, step: int = 1, confidence: None = None, @@ -75,7 +74,7 @@ def locateOnScreen( minSearchTime: float = 0, *, grayscale: bool | None = None, - limit: _Unused = 1, + limit: Unused = 1, region: tuple[int, int, int, int] | None = None, step: int = 1, confidence: SupportsFloat | SupportsIndex | str = 0.999, @@ -88,7 +87,7 @@ def locateOnScreen( minSearchTime: float = 0, *, grayscale: bool | None = None, - limit: _Unused = 1, + limit: Unused = 1, region: tuple[int, int, int, int] | None = None, step: int = 1, confidence: None = None, @@ -125,7 +124,7 @@ def locateCenterOnScreen( *, minSearchTime: float, grayscale: bool | None = None, - limit: _Unused = 1, + limit: Unused = 1, region: tuple[int, int, int, int] | None = None, step: int = 1, confidence: SupportsFloat | SupportsIndex | str = 0.999, @@ -138,7 +137,7 @@ def locateCenterOnScreen( *, minSearchTime: float, grayscale: bool | None = None, - limit: _Unused = 1, + limit: Unused = 1, region: tuple[int, int, int, int] | None = None, step: int = 1, confidence: None = None, @@ -151,7 +150,7 @@ def locateOnWindow( title: str, *, grayscale: bool | None = None, - limit: _Unused = 1, + limit: Unused = 1, step: int = 1, confidence: SupportsFloat | SupportsIndex | str = 0.999, ) -> Box | None: ... @@ -163,7 +162,7 @@ def locateOnWindow( title: str, *, grayscale: bool | None = None, - limit: _Unused = 1, + limit: Unused = 1, step: int = 1, confidence: None = None, ) -> Box | None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi index cb70b3cce3b6..6d42811133bd 100644 --- a/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/engine/url.pyi @@ -1,4 +1,4 @@ -from _typeshed import SupportsItems +from _typeshed import SupportsItems, Unused from collections.abc import Iterable, Mapping, Sequence from typing import Any, NamedTuple from typing_extensions import Self, TypeAlias @@ -6,11 +6,14 @@ from typing_extensions import Self, TypeAlias from ..util import immutabledict from .interfaces import Dialect +# object that produces a password when called with str() +_PasswordObject: TypeAlias = object + # stub-only helper class class _URLTuple(NamedTuple): drivername: str username: str | None - password: str | object | None # object that produces a password when called with str() + password: str | _PasswordObject | None host: str | None port: int | None database: str | None @@ -24,7 +27,7 @@ class URL(_URLTuple): cls, drivername: str, username: str | None = ..., - password: str | object | None = ..., # object that produces a password when called with str() + password: str | _PasswordObject | None = None, host: str | None = ..., port: int | None = ..., database: str | None = ..., @@ -34,7 +37,7 @@ class URL(_URLTuple): self, drivername: str | None = ..., username: str | None = ..., - password: str | object | None = ..., + password: str | _PasswordObject | None = None, host: str | None = ..., port: int | None = ..., database: str | None = ..., @@ -49,7 +52,7 @@ class URL(_URLTuple): def __to_string__(self, hide_password: bool = ...) -> str: ... def render_as_string(self, hide_password: bool = ...) -> str: ... def __copy__(self) -> Self: ... - def __deepcopy__(self, memo: object) -> Self: ... + def __deepcopy__(self, memo: Unused) -> Self: ... def __hash__(self) -> int: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/log.pyi b/stubs/SQLAlchemy/sqlalchemy/log.pyi index e4ccc821e6a5..98b20ef91797 100644 --- a/stubs/SQLAlchemy/sqlalchemy/log.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/log.pyi @@ -1,3 +1,4 @@ +from _typeshed import Unused from logging import Logger from typing import Any, TypeVar, overload from typing_extensions import Literal, Self, TypeAlias @@ -32,7 +33,7 @@ def instance_logger(instance: Identified, echoflag: _EchoFlag = ...) -> None: .. class echo_property: __doc__: str @overload - def __get__(self, instance: None, owner: object) -> Self: ... + def __get__(self, instance: None, owner: Unused) -> Self: ... @overload - def __get__(self, instance: Identified, owner: object) -> _EchoFlag: ... + def __get__(self, instance: Identified, owner: Unused) -> _EchoFlag: ... def __set__(self, instance: Identified, value: _EchoFlag) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi index 8938a45ad691..dc181862a452 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/decl_api.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused from collections.abc import Callable from typing import Any, ClassVar, TypeVar, overload from typing_extensions import TypeAlias @@ -28,7 +28,7 @@ _DeclarativeBaseMeta: TypeAlias = Callable[[str, tuple[type[Any], ...], dict[str def has_inherited_table(cls: type[Any]) -> bool: ... class DeclarativeMeta(type): - def __init__(cls, classname: str, bases: tuple[type[Any], ...], dict_: dict[str, Any], **kw: object) -> None: ... + def __init__(cls, classname: str, bases: tuple[type[Any], ...], dict_: dict[str, Any], **kw: Unused) -> None: ... def __setattr__(cls, key: str, value: Any) -> None: ... def __delattr__(cls, key: str) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi index 432e6e1dc756..9e197be62898 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/_collections.pyi @@ -1,5 +1,5 @@ import collections.abc -from _typeshed import Incomplete, SupportsKeysAndGetItem +from _typeshed import Incomplete, SupportsKeysAndGetItem, Unused from collections.abc import Callable, Iterable, Iterator, Mapping from typing import Any, Generic, NoReturn, TypeVar, overload from typing_extensions import Self @@ -16,9 +16,9 @@ collections_abc = collections.abc EMPTY_SET: frozenset[Any] class ImmutableContainer: - def __delitem__(self, *arg: object, **kw: object) -> NoReturn: ... - def __setitem__(self, *arg: object, **kw: object) -> NoReturn: ... - def __setattr__(self, *arg: object, **kw: object) -> NoReturn: ... + def __delitem__(self, *arg: Unused, **kw: Unused) -> NoReturn: ... + def __setitem__(self, *arg: Unused, **kw: Unused) -> NoReturn: ... + def __setattr__(self, *arg: Unused, **kw: Unused) -> NoReturn: ... @overload def coerce_to_immutabledict(d: None) -> immutabledict[Any, Any]: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi index c38631426b18..abc0bc2cdb9b 100644 --- a/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/util/langhelpers.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused from collections.abc import Callable from typing import Any, Generic, TypeVar, overload from typing_extensions import Self @@ -71,9 +71,9 @@ class memoized_property(Generic[_R]): __name__: str def __init__(self, fget: Callable[..., _R], doc: str | None = ...) -> None: ... @overload - def __get__(self, obj: None, cls: object) -> Self: ... + def __get__(self, obj: None, cls: Unused) -> Self: ... @overload - def __get__(self, obj: object, cls: object) -> _R: ... + def __get__(self, obj: object, cls: Unused) -> _R: ... @classmethod def reset(cls, obj: object, name: str) -> None: ... @@ -86,9 +86,9 @@ class HasMemoized: __name__: str def __init__(self, fget: Callable[..., _R], doc: str | None = ...) -> None: ... @overload - def __get__(self, obj: None, cls: object) -> Self: ... + def __get__(self, obj: None, cls: Unused) -> Self: ... @overload - def __get__(self, obj: object, cls: object) -> _R: ... + def __get__(self, obj: object, cls: Unused) -> _R: ... @classmethod def memoized_instancemethod(cls, fn): ... diff --git a/stubs/cachetools/cachetools/keys.pyi b/stubs/cachetools/cachetools/keys.pyi index 497bc1858bad..9b48a37ea791 100644 --- a/stubs/cachetools/cachetools/keys.pyi +++ b/stubs/cachetools/cachetools/keys.pyi @@ -1,7 +1,8 @@ +from _typeshed import Unused from collections.abc import Hashable __all__ = ("hashkey", "methodkey", "typedkey") def hashkey(*args: Hashable, **kwargs: Hashable) -> tuple[Hashable, ...]: ... -def methodkey(self: object, *args: Hashable, **kwargs: Hashable) -> tuple[Hashable, ...]: ... +def methodkey(self: Unused, *args: Hashable, **kwargs: Hashable) -> tuple[Hashable, ...]: ... def typedkey(*args: Hashable, **kwargs: Hashable) -> tuple[Hashable, ...]: ... diff --git a/stubs/croniter/croniter/croniter.pyi b/stubs/croniter/croniter/croniter.pyi index a0823b8c45c3..0799a69f8782 100644 --- a/stubs/croniter/croniter/croniter.pyi +++ b/stubs/croniter/croniter/croniter.pyi @@ -1,5 +1,5 @@ import datetime -from _typeshed import ReadableBuffer +from _typeshed import ReadableBuffer, Unused from collections import OrderedDict from collections.abc import Iterator from re import Match, Pattern @@ -121,7 +121,7 @@ class HashExpander: range_end: int | None = None, range_begin: int | None = None, ) -> int: ... - def match(self, efl: object, idx: object, expr: str, hash_id: object = None, **kw: object) -> Match[str] | None: ... + def match(self, efl: Unused, idx: Unused, expr: str, hash_id: Unused = None, **kw: Unused) -> Match[str] | None: ... def expand( self, efl: object, diff --git a/stubs/docutils/docutils/io.pyi b/stubs/docutils/docutils/io.pyi index cc836380a656..8a2a7d0724d0 100644 --- a/stubs/docutils/docutils/io.pyi +++ b/stubs/docutils/docutils/io.pyi @@ -5,6 +5,7 @@ from _typeshed import ( OpenTextModeReading, OpenTextModeWriting, SupportsWrite, + Unused, ) from re import Pattern from typing import Any, ClassVar @@ -88,7 +89,7 @@ class NullInput(Input): class NullOutput(Output): default_destination_path: ClassVar[str] - def write(self, data: object) -> None: ... + def write(self, data: Unused) -> None: ... class DocTreeInput(Input): default_source_path: ClassVar[str] diff --git a/stubs/fpdf2/fpdf/html.pyi b/stubs/fpdf2/fpdf/html.pyi index f3c6679eda07..34ae1968521b 100644 --- a/stubs/fpdf2/fpdf/html.pyi +++ b/stubs/fpdf2/fpdf/html.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused from collections.abc import Callable from html.parser import HTMLParser from logging import Logger @@ -68,7 +68,7 @@ class HTML2FPDF(HTMLParser): ul_bullet_char: str = ..., heading_sizes: Incomplete | None = None, warn_on_tags_not_matching: bool = True, - **_: object, + **_: Unused, ): ... def width2unit(self, length): ... def handle_data(self, data) -> None: ... diff --git a/stubs/fpdf2/fpdf/output.pyi b/stubs/fpdf2/fpdf/output.pyi index 533945b3666d..686abcbb4da8 100644 --- a/stubs/fpdf2/fpdf/output.pyi +++ b/stubs/fpdf2/fpdf/output.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused from collections import defaultdict from logging import Logger from typing_extensions import Final @@ -165,7 +165,7 @@ class PDFPagesRoot(PDFObject): class PDFExtGState(PDFObject): def __init__(self, dict_as_str) -> None: ... - def serialize(self, obj_dict: object = None, _security_handler: StandardSecurityHandler | None = None) -> str: ... + def serialize(self, obj_dict: Unused = None, _security_handler: StandardSecurityHandler | None = None) -> str: ... class PDFXrefAndTrailer(ContentWithoutID): output_builder: Incomplete diff --git a/stubs/fpdf2/fpdf/structure_tree.pyi b/stubs/fpdf2/fpdf/structure_tree.pyi index 1ce33a01c8ad..2aec226f5752 100644 --- a/stubs/fpdf2/fpdf/structure_tree.pyi +++ b/stubs/fpdf2/fpdf/structure_tree.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused from collections import defaultdict from collections.abc import Generator, Iterable @@ -8,7 +8,7 @@ from .syntax import PDFArray, PDFObject, PDFString class NumberTree(PDFObject): nums: defaultdict[Incomplete, list[Incomplete]] def __init__(self) -> None: ... - def serialize(self, obj_dict: object = ..., _security_handler: StandardSecurityHandler | None = None) -> str: ... + def serialize(self, obj_dict: Unused = None, _security_handler: StandardSecurityHandler | None = None) -> str: ... class StructTreeRoot(PDFObject): type: str diff --git a/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi b/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi index 10ba251a8acb..8a8dc1809b42 100644 --- a/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi +++ b/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi @@ -1,4 +1,5 @@ import datetime +from _typeshed import Unused from collections.abc import Callable, Iterable, Sequence from typing import Any, NoReturn from typing_extensions import Literal, Self, TypeAlias @@ -77,7 +78,7 @@ class Property(ModelAttribute): indexed: bool | None = ..., repeated: bool | None = ..., required: bool | None = ..., - default: object | None = ..., + default: object = None, choices: Iterable[object] | None = ..., validator: Callable[[Property, Any], object] | None = ..., verbose_name: str | None = ..., @@ -153,7 +154,7 @@ class JsonProperty(BlobProperty): indexed: bool | None = ..., repeated: bool | None = ..., required: bool | None = ..., - default: object | None = ..., + default: object = None, choices: Iterable[object] | None = ..., validator: Callable[[Property, Any], object] | None = ..., verbose_name: str | None = ..., @@ -423,7 +424,7 @@ def get_multi_async( memcache_timeout: int | None = ..., max_memcache_items: int | None = ..., force_writes: bool | None = ..., - _options: object | None = ..., + _options: object = None, ) -> list[type[tasklets_module.Future]]: ... def get_multi( keys: Sequence[type[key_module.Key]], @@ -441,7 +442,7 @@ def get_multi( memcache_timeout: int | None = ..., max_memcache_items: int | None = ..., force_writes: bool | None = ..., - _options: object | None = ..., + _options: object = None, ) -> list[type[Model] | None]: ... def put_multi_async( entities: list[type[Model]], @@ -456,7 +457,7 @@ def put_multi_async( memcache_timeout: int | None = ..., max_memcache_items: int | None = ..., force_writes: bool | None = ..., - _options: object | None = ..., + _options: object = None, ) -> list[tasklets_module.Future]: ... def put_multi( entities: list[Model], @@ -471,7 +472,7 @@ def put_multi( memcache_timeout: int | None = ..., max_memcache_items: int | None = ..., force_writes: bool | None = ..., - _options: object | None = ..., + _options: object = None, ) -> list[key_module.Key]: ... def delete_multi_async( keys: list[key_module.Key], @@ -486,7 +487,7 @@ def delete_multi_async( memcache_timeout: int | None = ..., max_memcache_items: int | None = ..., force_writes: bool | None = ..., - _options: object | None = ..., + _options: object = None, ) -> list[tasklets_module.Future]: ... def delete_multi( keys: Sequence[key_module.Key], @@ -501,7 +502,7 @@ def delete_multi( memcache_timeout: int | None = ..., max_memcache_items: int | None = ..., force_writes: bool | None = ..., - _options: object | None = ..., + _options: object = None, ) -> list[None]: ... -def get_indexes_async(**options: object) -> NoReturn: ... -def get_indexes(**options: object) -> NoReturn: ... +def get_indexes_async(**options: Unused) -> NoReturn: ... +def get_indexes(**options: Unused) -> NoReturn: ... diff --git a/stubs/ldap3/ldap3/utils/asn1.pyi b/stubs/ldap3/ldap3/utils/asn1.pyi index 811397e7ec9c..3f4bc709444f 100644 --- a/stubs/ldap3/ldap3/utils/asn1.pyi +++ b/stubs/ldap3/ldap3/utils/asn1.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete, IndexableBuffer, SliceableBuffer +from _typeshed import Incomplete, IndexableBuffer, SliceableBuffer, Unused from collections.abc import Callable, Mapping from typing import Any, TypeVar, overload from typing_extensions import Final, TypeAlias @@ -7,7 +7,6 @@ from pyasn1.codec.ber.encoder import AbstractItemEncoder # Use _typeshed._SupportsGetItemBuffer after PEP 688 _SupportsGetItemBuffer: TypeAlias = SliceableBuffer | IndexableBuffer -_Unused: TypeAlias = object _R = TypeVar("_R") _B = TypeVar("_B", bound=_SupportsGetItemBuffer) # The possible return type is a union of all other decode methods, ie: AnyOf[Incomplete | bool] @@ -18,7 +17,7 @@ CLASSES: Final[dict[tuple[bool, bool], int]] class LDAPBooleanEncoder(AbstractItemEncoder): supportIndefLenMode: bool # Requires pyasn1 > 0.3.7 - def encodeValue(self, value: bool | int, asn1Spec: _Unused, encodeFun: _Unused, **options: _Unused): ... + def encodeValue(self, value: bool | int, asn1Spec: Unused, encodeFun: Unused, **options: Unused): ... def compute_ber_size(data): ... def decode_message_fast(message): ... @@ -28,13 +27,13 @@ def decode_sequence(message: _B, start: int, stop: int, context_decoders: Mappin def decode_sequence( message: _SupportsGetItemBuffer, start: int, stop: int, context_decoders: None = ... ) -> _AllDecodersReturnType: ... -def decode_integer(message, start: int, stop: int, context_decoders: _Unused = ...): ... -def decode_octet_string(message, start: int, stop: int, context_decoders: _Unused = ...): ... -def decode_boolean(message, start: int, stop: int, context_decoders: _Unused = ...): ... -def decode_bind_response(message, start: int, stop: int, context_decoders: _Unused = ...): ... -def decode_extended_response(message, start: int, stop: int, context_decoders: _Unused = ...): ... -def decode_intermediate_response(message, start: int, stop: int, context_decoders: _Unused = ...): ... -def decode_controls(message, start: int, stop: int, context_decoders: _Unused = ...): ... +def decode_integer(message, start: int, stop: int, context_decoders: Unused = ...): ... +def decode_octet_string(message, start: int, stop: int, context_decoders: Unused = ...): ... +def decode_boolean(message, start: int, stop: int, context_decoders: Unused = ...): ... +def decode_bind_response(message, start: int, stop: int, context_decoders: Unused = ...): ... +def decode_extended_response(message, start: int, stop: int, context_decoders: Unused = ...): ... +def decode_intermediate_response(message, start: int, stop: int, context_decoders: Unused = ...): ... +def decode_controls(message, start: int, stop: int, context_decoders: Unused = ...): ... def ldap_result_to_dict_fast(response): ... def get_byte(x): ... def get_bytes(x): ... diff --git a/stubs/mypy-extensions/mypy_extensions.pyi b/stubs/mypy-extensions/mypy_extensions.pyi index 7bc5c1fbfd4d..8565793c2486 100644 --- a/stubs/mypy-extensions/mypy_extensions.pyi +++ b/stubs/mypy-extensions/mypy_extensions.pyi @@ -1,7 +1,7 @@ import abc import sys from _collections_abc import dict_items, dict_keys, dict_values -from _typeshed import IdentityFunction +from _typeshed import IdentityFunction, Unused from collections.abc import Mapping from typing import Any, ClassVar, Generic, TypeVar, overload, type_check_only from typing_extensions import Never, Self @@ -65,7 +65,7 @@ class NoReturn: ... # a class decorator, but mypy does not support type[_T] for abstract # classes until this issue is resolved, https://github.com/python/mypy/issues/4717. def trait(cls: _T) -> _T: ... -def mypyc_attr(*attrs: str, **kwattrs: object) -> IdentityFunction: ... +def mypyc_attr(*attrs: str, **kwattrs: Unused) -> IdentityFunction: ... class FlexibleAlias(Generic[_T, _U]): ... diff --git a/stubs/mysqlclient/MySQLdb/times.pyi b/stubs/mysqlclient/MySQLdb/times.pyi index ecca1add5cb7..21a14cfc8551 100644 --- a/stubs/mysqlclient/MySQLdb/times.pyi +++ b/stubs/mysqlclient/MySQLdb/times.pyi @@ -1,3 +1,4 @@ +from _typeshed import Unused from datetime import date, datetime, time, timedelta from MySQLdb._mysql import string_literal as string_literal @@ -22,5 +23,5 @@ def DateTime_or_None(s: str) -> datetime | None: ... def TimeDelta_or_None(s: str) -> timedelta | None: ... def Time_or_None(s: str) -> time | None: ... def Date_or_None(s: str) -> date | None: ... -def DateTime2literal(d: datetime, c: object) -> str: ... -def DateTimeDelta2literal(d: datetime, c: object) -> str: ... +def DateTime2literal(d: datetime, c: Unused) -> str: ... +def DateTimeDelta2literal(d: datetime, c: Unused) -> str: ... diff --git a/stubs/netaddr/netaddr/ip/__init__.pyi b/stubs/netaddr/netaddr/ip/__init__.pyi index b688de8582b7..91651b731527 100644 --- a/stubs/netaddr/netaddr/ip/__init__.pyi +++ b/stubs/netaddr/netaddr/ip/__init__.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused from abc import abstractmethod from collections.abc import Iterable, Iterator from typing import SupportsInt, overload @@ -133,7 +133,7 @@ class IPNetwork(BaseIP, IPListMixin): def previous(self, step: int = ...) -> Self: ... def next(self, step: int = ...) -> Self: ... def supernet(self, prefixlen: int = ...) -> list[IPNetwork]: ... - def subnet(self, prefixlen: int, count: int | None = ..., fmt: object | None = ...) -> Iterator[Self]: ... + def subnet(self, prefixlen: int, count: int | None = ..., fmt: Unused = None) -> Iterator[Self]: ... def iter_hosts(self) -> Iterator[IPAddress]: ... class IPRange(BaseIP, IPListMixin): diff --git a/stubs/netaddr/netaddr/strategy/ipv4.pyi b/stubs/netaddr/netaddr/strategy/ipv4.pyi index 2fdbe1ae6cbf..763a858cbde8 100644 --- a/stubs/netaddr/netaddr/strategy/ipv4.pyi +++ b/stubs/netaddr/netaddr/strategy/ipv4.pyi @@ -1,3 +1,4 @@ +from _typeshed import Unused from collections.abc import Iterable, Sequence from socket import AddressFamily from typing_extensions import Literal @@ -22,7 +23,7 @@ hostmask_to_prefix: dict[int, int] def valid_str(addr: str, flags: int = ...) -> bool: ... def str_to_int(addr: str, flags: int = ...) -> int: ... -def int_to_str(int_val: int, dialect: object | None = ...) -> str: ... +def int_to_str(int_val: int, dialect: Unused = None) -> str: ... def int_to_arpa(int_val: int) -> str: ... def int_to_packed(int_val: int) -> bytes: ... def packed_to_int(packed_int: bytes) -> int: ... diff --git a/stubs/paho-mqtt/paho/mqtt/client.pyi b/stubs/paho-mqtt/paho/mqtt/client.pyi index a06eddcca262..2cbe23800b45 100644 --- a/stubs/paho-mqtt/paho/mqtt/client.pyi +++ b/stubs/paho-mqtt/paho/mqtt/client.pyi @@ -3,7 +3,7 @@ import socket as _socket import ssl as _ssl import time import types -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused from collections.abc import Callable from typing import Any, TypeVar from typing_extensions import TypeAlias @@ -225,7 +225,7 @@ class Client: def loop_misc(self) -> int: ... def max_inflight_messages_set(self, inflight: int) -> None: ... def max_queued_messages_set(self, queue_size: int) -> Client: ... - def message_retry_set(self, retry: object) -> None: ... + def message_retry_set(self, retry: Unused) -> None: ... def user_data_set(self, userdata: _UserData) -> None: ... def will_set( self, topic: str, payload: _Payload | None = ..., qos: int = ..., retain: bool = ..., properties: Properties | None = ... diff --git a/stubs/pyasn1/pyasn1/codec/ber/decoder.pyi b/stubs/pyasn1/pyasn1/codec/ber/decoder.pyi index 03afbebd244c..a2544e0c263e 100644 --- a/stubs/pyasn1/pyasn1/codec/ber/decoder.pyi +++ b/stubs/pyasn1/pyasn1/codec/ber/decoder.pyi @@ -1,14 +1,11 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused from abc import ABCMeta, abstractmethod from collections.abc import Callable -from typing_extensions import TypeAlias from pyasn1.type import base, char, univ, useful from pyasn1.type.base import Asn1Type from pyasn1.type.tag import TagSet -_Unused: TypeAlias = object - class AbstractDecoder: protoComponent: Asn1Type | None @abstractmethod @@ -48,7 +45,7 @@ class ExplicitTagDecoder(AbstractSimpleDecoder): asn1Spec, tagSet: TagSet | None = ..., length: int | None = ..., - state: _Unused = ..., + state: Unused = ..., decodeFun: Callable[..., Incomplete] | None = ..., substrateFun: Callable[..., Incomplete] | None = ..., **options, @@ -59,7 +56,7 @@ class ExplicitTagDecoder(AbstractSimpleDecoder): asn1Spec, tagSet: TagSet | None = ..., length: int | None = ..., - state: _Unused = ..., + state: Unused = ..., decodeFun: Callable[..., Incomplete] | None = ..., substrateFun: Callable[..., Incomplete] | None = ..., **options, @@ -73,9 +70,9 @@ class IntegerDecoder(AbstractSimpleDecoder): asn1Spec, tagSet: TagSet | None = ..., length: int | None = ..., - state: _Unused = ..., - decodeFun: _Unused = ..., - substrateFun: _Unused = ..., + state: Unused = ..., + decodeFun: Unused = ..., + substrateFun: Unused = ..., **options, ): ... @@ -91,7 +88,7 @@ class BitStringDecoder(AbstractSimpleDecoder): asn1Spec, tagSet: TagSet | None = ..., length: int | None = ..., - state: _Unused = ..., + state: Unused = ..., decodeFun: Callable[..., Incomplete] | None = ..., substrateFun: Callable[..., Incomplete] | None = ..., **options, @@ -102,7 +99,7 @@ class BitStringDecoder(AbstractSimpleDecoder): asn1Spec, tagSet: TagSet | None = ..., length: int | None = ..., - state: _Unused = ..., + state: Unused = ..., decodeFun: Callable[..., Incomplete] | None = ..., substrateFun: Callable[..., Incomplete] | None = ..., **options, @@ -117,7 +114,7 @@ class OctetStringDecoder(AbstractSimpleDecoder): asn1Spec, tagSet: TagSet | None = ..., length: int | None = ..., - state: _Unused = ..., + state: Unused = ..., decodeFun: Callable[..., Incomplete] | None = ..., substrateFun: Callable[..., Incomplete] | None = ..., **options, @@ -128,7 +125,7 @@ class OctetStringDecoder(AbstractSimpleDecoder): asn1Spec, tagSet: TagSet | None = ..., length: int | None = ..., - state: _Unused = ..., + state: Unused = ..., decodeFun: Callable[..., Incomplete] | None = ..., substrateFun: Callable[..., Incomplete] | None = ..., **options, @@ -142,9 +139,9 @@ class NullDecoder(AbstractSimpleDecoder): asn1Spec, tagSet: TagSet | None = ..., length: int | None = ..., - state: _Unused = ..., - decodeFun: _Unused = ..., - substrateFun: _Unused = ..., + state: Unused = ..., + decodeFun: Unused = ..., + substrateFun: Unused = ..., **options, ): ... @@ -156,9 +153,9 @@ class ObjectIdentifierDecoder(AbstractSimpleDecoder): asn1Spec, tagSet: TagSet | None = ..., length: int | None = ..., - state: _Unused = ..., - decodeFun: _Unused = ..., - substrateFun: _Unused = ..., + state: Unused = ..., + decodeFun: Unused = ..., + substrateFun: Unused = ..., **options, ): ... @@ -170,9 +167,9 @@ class RealDecoder(AbstractSimpleDecoder): asn1Spec, tagSet: TagSet | None = ..., length: int | None = ..., - state: _Unused = ..., - decodeFun: _Unused = ..., - substrateFun: _Unused = ..., + state: Unused = ..., + decodeFun: Unused = ..., + substrateFun: Unused = ..., **options, ): ... @@ -188,7 +185,7 @@ class UniversalConstructedTypeDecoder(AbstractConstructedDecoder): asn1Spec, tagSet: TagSet | None = ..., length: int | None = ..., - state: _Unused = ..., + state: Unused = ..., decodeFun: Callable[..., Incomplete] | None = ..., substrateFun: Callable[..., Incomplete] | None = ..., **options, @@ -199,7 +196,7 @@ class UniversalConstructedTypeDecoder(AbstractConstructedDecoder): asn1Spec, tagSet: TagSet | None = ..., length: int | None = ..., - state: _Unused = ..., + state: Unused = ..., decodeFun: Callable[..., Incomplete] | None = ..., substrateFun: Callable[..., Incomplete] | None = ..., **options, @@ -258,8 +255,8 @@ class AnyDecoder(AbstractSimpleDecoder): asn1Spec, tagSet: TagSet | None = ..., length: int | None = ..., - state: _Unused = ..., - decodeFun: _Unused = ..., + state: Unused = ..., + decodeFun: Unused = ..., substrateFun: Callable[..., Incomplete] | None = ..., **options, ): ... @@ -269,7 +266,7 @@ class AnyDecoder(AbstractSimpleDecoder): asn1Spec, tagSet: TagSet | None = ..., length: int | None = ..., - state: _Unused = ..., + state: Unused = ..., decodeFun: Callable[..., Incomplete] | None = ..., substrateFun: Callable[..., Incomplete] | None = ..., **options, @@ -329,7 +326,7 @@ class Decoder: tagSet: TagSet | None = ..., length: int | None = ..., state=..., - decodeFun: _Unused = ..., + decodeFun: Unused = ..., substrateFun: Callable[..., Incomplete] | None = ..., **options, ): ... diff --git a/stubs/pyasn1/pyasn1/codec/cer/decoder.pyi b/stubs/pyasn1/pyasn1/codec/cer/decoder.pyi index fc9640151414..22f51cdc0356 100644 --- a/stubs/pyasn1/pyasn1/codec/cer/decoder.pyi +++ b/stubs/pyasn1/pyasn1/codec/cer/decoder.pyi @@ -1,11 +1,9 @@ -from typing_extensions import TypeAlias +from _typeshed import Unused from pyasn1.codec.ber import decoder from pyasn1.type import univ from pyasn1.type.tag import TagSet -_Unused: TypeAlias = object - class BooleanDecoder(decoder.AbstractSimpleDecoder): protoComponent: univ.Boolean def valueDecoder( @@ -14,9 +12,9 @@ class BooleanDecoder(decoder.AbstractSimpleDecoder): asn1Spec, tagSet: TagSet | None = ..., length: int | None = ..., - state: _Unused = ..., - decodeFun: _Unused = ..., - substrateFun: _Unused = ..., + state: Unused = ..., + decodeFun: Unused = ..., + substrateFun: Unused = ..., **options, ): ... diff --git a/stubs/pyasn1/pyasn1/codec/native/decoder.pyi b/stubs/pyasn1/pyasn1/codec/native/decoder.pyi index 47296d667536..09d7b4eb0959 100644 --- a/stubs/pyasn1/pyasn1/codec/native/decoder.pyi +++ b/stubs/pyasn1/pyasn1/codec/native/decoder.pyi @@ -1,14 +1,11 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused from collections.abc import Callable -from typing_extensions import TypeAlias - -_Unused: TypeAlias = object class AbstractScalarDecoder: - def __call__(self, pyObject, asn1Spec, decodeFun: _Unused = ..., **options): ... + def __call__(self, pyObject, asn1Spec, decodeFun: Unused = ..., **options): ... class BitStringDecoder(AbstractScalarDecoder): - def __call__(self, pyObject, asn1Spec, decodeFun: _Unused = ..., **options): ... + def __call__(self, pyObject, asn1Spec, decodeFun: Unused = ..., **options): ... class SequenceOrSetDecoder: def __call__(self, pyObject, asn1Spec, decodeFun: Callable[..., Incomplete] | None = ..., **options): ... diff --git a/stubs/pyasn1/pyasn1/type/base.pyi b/stubs/pyasn1/pyasn1/type/base.pyi index 455f33c8aff8..b1b5e17f5e15 100644 --- a/stubs/pyasn1/pyasn1/type/base.pyi +++ b/stubs/pyasn1/pyasn1/type/base.pyi @@ -1,5 +1,5 @@ -from _typeshed import Incomplete -from typing import type_check_only +from _typeshed import Incomplete, Unused +from typing import NoReturn, type_check_only from typing_extensions import final from pyasn1.type import constraint, namedtype @@ -41,7 +41,7 @@ class NoValue: def __getattr__(self, attr) -> None: ... # def __new__..getPlug..plug @type_check_only - def plug(self, *args: object, **kw: object): ... + def plug(self, *args: Unused, **kw: Unused) -> NoReturn: ... # Magic methods assigned dynamically, priority from right to left: plug < str < int < list < dict __abs__ = int.__abs__ __add__ = list.__add__ diff --git a/stubs/python-crontab/crontab.pyi b/stubs/python-crontab/crontab.pyi index d0335e8365a3..7dbeb53eb91c 100644 --- a/stubs/python-crontab/crontab.pyi +++ b/stubs/python-crontab/crontab.pyi @@ -1,6 +1,6 @@ import re import subprocess -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused from builtins import range as _range from collections import OrderedDict from collections.abc import Callable, Generator, Iterable, Iterator @@ -70,7 +70,7 @@ class CronTab: # work for `CronItem` subclasses, which might define other kwargs. def run_pending(self, **kwargs: Any) -> Iterator[str]: ... # There are two known kwargs and others are unused: - def run_scheduler(self, timeout: int = ..., *, warp: object = ..., cadence: int = ..., **kwargs: object) -> Iterator[str]: ... + def run_scheduler(self, timeout: int = ..., *, warp: object = ..., cadence: int = ..., **kwargs: Unused) -> Iterator[str]: ... def render(self, errors: bool = ..., specials: bool | None = ...) -> str: ... def new( self, diff --git a/stubs/pytz/pytz/__init__.pyi b/stubs/pytz/pytz/__init__.pyi index 6a2f148a62c7..e6b4d99a136a 100644 --- a/stubs/pytz/pytz/__init__.pyi +++ b/stubs/pytz/pytz/__init__.pyi @@ -1,4 +1,5 @@ import datetime +from _typeshed import Unused from collections.abc import Mapping from typing import ClassVar @@ -26,9 +27,9 @@ def timezone(zone: str) -> _UTCclass | StaticTzInfo | DstTzInfo: ... class _FixedOffset(datetime.tzinfo): zone: ClassVar[None] def __init__(self, minutes: int) -> None: ... - def utcoffset(self, dt: object) -> datetime.timedelta | None: ... - def dst(self, dt: object) -> datetime.timedelta: ... - def tzname(self, dt: object) -> None: ... + def utcoffset(self, dt: Unused) -> datetime.timedelta | None: ... + def dst(self, dt: Unused) -> datetime.timedelta: ... + def tzname(self, dt: Unused) -> None: ... def localize(self, dt: datetime.datetime, is_dst: bool = ...) -> datetime.datetime: ... def normalize(self, dt: datetime.datetime, is_dst: bool = ...) -> datetime.datetime: ... diff --git a/stubs/redis/redis/cluster.pyi b/stubs/redis/redis/cluster.pyi index de4acb86dba9..fd4e906e6e06 100644 --- a/stubs/redis/redis/cluster.pyi +++ b/stubs/redis/redis/cluster.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused from collections.abc import Callable, Iterable, Sequence from threading import Lock from types import TracebackType @@ -15,8 +15,8 @@ from redis.typing import EncodableT def get_node_name(host: str, port: str | int) -> str: ... def get_connection(redis_node: Redis[Any], *args, **options: _ConnectionPoolOptions) -> Connection: ... -def parse_scan_result(command: object, res, **options): ... -def parse_pubsub_numsub(command: object, res, **options: object): ... +def parse_scan_result(command: Unused, res, **options): ... +def parse_pubsub_numsub(command: Unused, res, **options: Unused): ... def parse_cluster_slots(resp, **options) -> dict[tuple[int, int], dict[str, Any]]: ... PRIMARY: str diff --git a/stubs/redis/redis/connection.pyi b/stubs/redis/redis/connection.pyi index 576c144fe194..a409a9d83ae0 100644 --- a/stubs/redis/redis/connection.pyi +++ b/stubs/redis/redis/connection.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused from collections.abc import Callable, Iterable, Mapping from queue import Queue from socket import socket @@ -132,7 +132,7 @@ class Connection: def set_parser(self, parser_class: type[BaseParser]) -> None: ... def connect(self) -> None: ... def on_connect(self) -> None: ... - def disconnect(self, *args: object) -> None: ... # 'args' added in redis 4.1.2 + def disconnect(self, *args: Unused) -> None: ... # 'args' added in redis 4.1.2 def check_health(self) -> None: ... def send_packed_command(self, command: str | Iterable[str], check_health: bool = ...) -> None: ... def send_command(self, *args, **kwargs) -> None: ... @@ -207,7 +207,7 @@ class ConnectionPool: self, connection_class: type[Connection] = ..., max_connections: int | None = ..., **connection_kwargs ) -> None: ... def reset(self) -> None: ... - def get_connection(self, command_name: object, *keys, **options: _ConnectionPoolOptions) -> Connection: ... + def get_connection(self, command_name: Unused, *keys, **options: _ConnectionPoolOptions) -> Connection: ... def make_connection(self) -> Connection: ... def release(self, connection: Connection) -> None: ... def disconnect(self, inuse_connections: bool = ...) -> None: ... diff --git a/stubs/redis/redis/utils.pyi b/stubs/redis/redis/utils.pyi index 09f261095d6f..7a562c4b1b2e 100644 --- a/stubs/redis/redis/utils.pyi +++ b/stubs/redis/redis/utils.pyi @@ -1,3 +1,4 @@ +from _typeshed import Unused from collections.abc import Iterable, Mapping from contextlib import AbstractContextManager from typing import Any, TypeVar, overload @@ -19,4 +20,4 @@ def str_if_bytes(value: str | bytes) -> str: ... def safe_str(value: object) -> str: ... def dict_merge(*dicts: Mapping[str, _T]) -> dict[str, _T]: ... def list_keys_to_dict(key_list, callback): ... # unused, alias for `dict.fromkeys` -def merge_result(command: object, res: Mapping[Any, Iterable[_T]]) -> list[_T]: ... +def merge_result(command: Unused, res: Mapping[Any, Iterable[_T]]) -> list[_T]: ... diff --git a/stubs/setuptools/setuptools/command/test.pyi b/stubs/setuptools/setuptools/command/test.pyi index 0ee33879b6c8..1b7a32f4f4b6 100644 --- a/stubs/setuptools/setuptools/command/test.pyi +++ b/stubs/setuptools/setuptools/command/test.pyi @@ -1,4 +1,4 @@ -from _typeshed import Incomplete +from _typeshed import Incomplete, Unused from collections.abc import Callable from types import ModuleType from typing import Any, Generic, TypeVar, overload @@ -17,9 +17,9 @@ class NonDataProperty(Generic[_T]): fget: Callable[..., _T] def __init__(self, fget: Callable[..., _T]) -> None: ... @overload - def __get__(self, obj: None, objtype: object = ...) -> Self: ... + def __get__(self, obj: None, objtype: Unused = None) -> Self: ... @overload - def __get__(self, obj: Any, objtype: object = ...) -> _T: ... + def __get__(self, obj: Any, objtype: Unused = None) -> _T: ... class test(Command): description: str diff --git a/stubs/six/six/__init__.pyi b/stubs/six/six/__init__.pyi index 8c72cce7e419..c1977c05de71 100644 --- a/stubs/six/six/__init__.pyi +++ b/stubs/six/six/__init__.pyi @@ -2,7 +2,7 @@ import builtins import operator import types import unittest -from _typeshed import IdentityFunction, _KT_contra, _VT_co +from _typeshed import IdentityFunction, Unused, _KT_contra, _VT_co from builtins import next as next from collections.abc import Callable, ItemsView, Iterable, Iterator as _Iterator, KeysView, Mapping, ValuesView from functools import wraps as wraps @@ -99,7 +99,7 @@ def python_2_unicode_compatible(klass: _T) -> _T: ... class _LazyDescr: name: str def __init__(self, name: str) -> None: ... - def __get__(self, obj: object | None, tp: object) -> Any: ... + def __get__(self, obj: object, tp: Unused) -> Any: ... class MovedModule(_LazyDescr): mod: str