diff --git a/stubs/ExifRead/exifread/utils.pyi b/stubs/ExifRead/exifread/utils.pyi index 0f8c58219..77034f00e 100644 --- a/stubs/ExifRead/exifread/utils.pyi +++ b/stubs/ExifRead/exifread/utils.pyi @@ -6,7 +6,7 @@ from typing_extensions import Self _T = TypeVar("_T") @overload -def ord_(dta: str) -> int: ... # type: ignore[misc] +def ord_(dta: str) -> int: ... # type: ignore[overload-overlap] @overload def ord_(dta: _T) -> _T: ... def make_string(seq: str | list[int]) -> str: ... diff --git a/stubs/Flask-Cors/flask_cors/core.pyi b/stubs/Flask-Cors/flask_cors/core.pyi index c69cfe507..842733aac 100644 --- a/stubs/Flask-Cors/flask_cors/core.pyi +++ b/stubs/Flask-Cors/flask_cors/core.pyi @@ -55,7 +55,7 @@ def get_app_kwarg_dict(appInstance: flask.Flask | None = None) -> _Options: ... def flexible_str(obj: object) -> str | None: ... def serialize_option(options_dict: _Options, key: str, upper: bool = False) -> None: ... @overload -def ensure_iterable(inst: str) -> list[str]: ... # type: ignore[misc] +def ensure_iterable(inst: str) -> list[str]: ... # type: ignore[overload-overlap] @overload def ensure_iterable(inst: _IterableT) -> _IterableT: ... @overload diff --git a/stubs/WebOb/webob/multidict.pyi b/stubs/WebOb/webob/multidict.pyi index 2d525a355..823fafe97 100644 --- a/stubs/WebOb/webob/multidict.pyi +++ b/stubs/WebOb/webob/multidict.pyi @@ -37,7 +37,7 @@ class MultiDict(MutableMapping[_KT, _VT]): def clear(self) -> None: ... def copy(self) -> Self: ... @overload - def setdefault(self, key: _KT, default: None = None) -> _VT | None: ... # type:ignore[misc] + def setdefault(self, key: _KT, default: None = None) -> _VT | None: ... @overload def setdefault(self, key: _KT, default: _VT) -> _VT: ... @overload diff --git a/stubs/fpdf2/fpdf/fpdf.pyi b/stubs/fpdf2/fpdf/fpdf.pyi index e2b0a38bb..079f64e94 100644 --- a/stubs/fpdf2/fpdf/fpdf.pyi +++ b/stubs/fpdf2/fpdf/fpdf.pyi @@ -562,7 +562,7 @@ class FPDF(GraphicsStateMixin): width: int | None = None, ) -> _GeneratorContextManager[Table]: ... @overload - def output( # type: ignore[misc] + def output( # type: ignore[overload-overlap] self, name: Literal[""] | None = "", dest: Unused = "", diff --git a/stubs/mock/mock/mock.pyi b/stubs/mock/mock/mock.pyi index 04e314e30..b8e043523 100644 --- a/stubs/mock/mock/mock.pyi +++ b/stubs/mock/mock/mock.pyi @@ -227,7 +227,7 @@ class _patcher: TEST_PREFIX: str dict: type[_patch_dict] @overload - def __call__( # type: ignore[misc] + def __call__( self, target: Any, *, @@ -257,7 +257,7 @@ class _patcher: **kwargs: Any, ) -> _patch[_T]: ... @overload - def object( # type: ignore[misc] + def object( self, target: Any, attribute: str, diff --git a/stubs/openpyxl/openpyxl/descriptors/base.pyi b/stubs/openpyxl/openpyxl/descriptors/base.pyi index 6e62f1e88..394100592 100644 --- a/stubs/openpyxl/openpyxl/descriptors/base.pyi +++ b/stubs/openpyxl/openpyxl/descriptors/base.pyi @@ -265,9 +265,7 @@ class Bool(Convertible[bool, _N]): def __init__(self: Bool[Literal[True]], name: str | None = None, *, allow_none: Literal[True]) -> None: ... @overload def __init__(self: Bool[Literal[False]], name: str | None = None, *, allow_none: Literal[False] = False) -> None: ... - def __set__( # type:ignore[override] # Different restrictions - self, instance: Serialisable | Strict, value: _ConvertibleToBool - ) -> None: ... + def __set__(self, instance: Serialisable | Strict, value: _ConvertibleToBool) -> None: ... class String(Typed[str, _N]): allow_none: _N diff --git a/stubs/openpyxl/openpyxl/descriptors/nested.pyi b/stubs/openpyxl/openpyxl/descriptors/nested.pyi index 8a7af3be8..3967df4c3 100644 --- a/stubs/openpyxl/openpyxl/descriptors/nested.pyi +++ b/stubs/openpyxl/openpyxl/descriptors/nested.pyi @@ -131,10 +131,10 @@ class NestedText(NestedValue[_T, _N]): @overload def __get__(self: NestedText[_T, Literal[False]], instance: Serialisable | Strict, cls: type | None = None) -> _T: ... # NOTE: It is currently impossible to make a generic based on the parameter type of another generic - # So we implement explicitely the types used internally + # So we implement explicitly the types used internally # str @overload - def __set__( # type: ignore[misc] # Incompatible return type because of NoReturn + def __set__( # type: ignore[overload-overlap] self: NestedText[str, _N], instance: Serialisable | Strict, value: object # Not[None] when _N = False ) -> None: ... # int @@ -176,12 +176,10 @@ class NestedBool(NestedValue[bool, _N], Bool[_N]): # type: ignore[misc] def __init__(self: NestedBool[Literal[True]], name: str | None = None, *, allow_none: Literal[True]) -> None: ... @overload def __init__(self: NestedBool[Literal[False]], name: str | None = None, *, allow_none: Literal[False] = False) -> None: ... - def __set__( # type:ignore[override] # Different restrictions - self, instance: Serialisable | Strict, value: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool - ) -> None: ... - def from_tree(self, node: _HasGet[bool]) -> bool: ... # type: ignore[override] # Actual overriden return type + def __set__(self, instance: Serialisable | Strict, value: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool) -> None: ... + def from_tree(self, node: _HasGet[bool]) -> bool: ... -class NestedNoneSet(Nested[_T | None], NoneSet[_T]): # type: ignore[misc] +class NestedNoneSet(Nested[_T | None], NoneSet[_T]): def __init__(self, name: str | None = None, *, values: Iterable[_T | None]) -> None: ... def __set__(self, instance: Serialisable | Strict, value: _NestedNoneSetParam[_T]) -> None: ... @@ -264,8 +262,6 @@ class EmptyTag(Nested[bool], Bool[_N]): # type: ignore[misc] def __get__(self: EmptyTag[Literal[True]], instance: Serialisable | Strict, cls: type | None = None) -> bool | None: ... @overload def __get__(self: EmptyTag[Literal[False]], instance: Serialisable | Strict, cls: type | None = None) -> bool: ... - def __set__( # type:ignore[override] # Different restrictions - self, instance: Serialisable | Strict, value: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool - ) -> None: ... - def from_tree(self, node: Unused) -> Literal[True]: ... # type: ignore[override] # Actual overriden return type + def __set__(self, instance: Serialisable | Strict, value: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool) -> None: ... + def from_tree(self, node: Unused) -> Literal[True]: ... def to_tree(self, tagname: str | None = None, value: Incomplete | None = None, namespace: str | None = None) -> Element: ... diff --git a/stubs/openpyxl/openpyxl/formatting/rule.pyi b/stubs/openpyxl/openpyxl/formatting/rule.pyi index 2ccd4f9f0..d39fddf39 100644 --- a/stubs/openpyxl/openpyxl/formatting/rule.pyi +++ b/stubs/openpyxl/openpyxl/formatting/rule.pyi @@ -69,7 +69,7 @@ _RuleType: TypeAlias = Literal[ class ValueDescriptor(Float[Incomplete]): expected_type: type[Incomplete] - def __set__(self, instance: Serialisable | Strict, value) -> None: ... # type: ignore[override] + def __set__(self, instance: Serialisable | Strict, value) -> None: ... class FormatObject(Serialisable): tagname: ClassVar[str] diff --git a/stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi b/stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi index 1eee4c237..e99694d1a 100644 --- a/stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi +++ b/stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi @@ -77,7 +77,7 @@ def fromstring(text: str | ReadableBuffer, parser: XMLParser | None = None) -> E # from lxml.etree import fromstring # But made partial, removing parser arg @overload -def fromstring(text: str | bytes, *, base_url: str | bytes = ...) -> _lxml_Element: ... # type: ignore[misc] # Overlap with incompatible return types +def fromstring(text: str | bytes, *, base_url: str | bytes = ...) -> _lxml_Element: ... # type: ignore[overload-overlap] # from defusedxml.ElementTree import fromstring @overload diff --git a/stubs/paramiko/paramiko/rsakey.pyi b/stubs/paramiko/paramiko/rsakey.pyi index ade72fde4..d0596f8a7 100644 --- a/stubs/paramiko/paramiko/rsakey.pyi +++ b/stubs/paramiko/paramiko/rsakey.pyi @@ -27,7 +27,7 @@ class RSAKey(PKey): def get_name(self) -> str: ... def get_bits(self) -> int: ... def can_sign(self) -> bool: ... - def sign_ssh_data(self, data: bytes, algorithm: str | None = None) -> Message: ... # type: ignore[override] + def sign_ssh_data(self, data: bytes, algorithm: str | None = None) -> Message: ... def verify_ssh_sig(self, data: bytes, msg: Message) -> bool: ... def write_private_key_file(self, filename: str, password: str | None = None) -> None: ... def write_private_key(self, file_obj: IO[str], password: str | None = None) -> None: ... diff --git a/stubs/parsimonious/parsimonious/grammar.pyi b/stubs/parsimonious/parsimonious/grammar.pyi index 76e17e230..efe971f20 100644 --- a/stubs/parsimonious/parsimonious/grammar.pyi +++ b/stubs/parsimonious/parsimonious/grammar.pyi @@ -44,7 +44,9 @@ class RuleVisitor(NodeVisitor[tuple[OrderedDict[str, Expression], Expression | N def visit_regex(self, node: Node, regex: collections.abc.Sequence[Any]) -> Regex: ... def visit_spaceless_literal(self, spaceless_literal: Node, visited_children: collections.abc.Sequence[Any]) -> Literal: ... def visit_literal(self, node: Node, literal: collections.abc.Sequence[Any]) -> Literal: ... - def generic_visit(self, node: Node, visited_children: collections.abc.Sequence[Any]) -> collections.abc.Sequence[Any] | Node: ... # type: ignore[override] + def generic_visit( + self, node: Node, visited_children: collections.abc.Sequence[Any] + ) -> collections.abc.Sequence[Any] | Node: ... def visit_rules( self, node: Node, rules_list: collections.abc.Sequence[Any] ) -> tuple[OrderedDict[str, Expression], Expression | None]: ... diff --git a/stubs/pika/pika/adapters/twisted_connection.pyi b/stubs/pika/pika/adapters/twisted_connection.pyi index 6d639bb10..f71637a8a 100644 --- a/stubs/pika/pika/adapters/twisted_connection.pyi +++ b/stubs/pika/pika/adapters/twisted_connection.pyi @@ -6,11 +6,14 @@ from typing import Generic, NamedTuple, TypeVar import pika.connection from pika.adapters.utils import nbio_interface -from twisted.internet.base import DelayedCall # type: ignore[import] # pyright: ignore[reportMissingImports] -from twisted.internet.defer import Deferred, DeferredQueue # type: ignore[import] # pyright: ignore[reportMissingImports] -from twisted.internet.interfaces import ITransport # type: ignore[import] # pyright: ignore[reportMissingImports] -from twisted.internet.protocol import Protocol # type: ignore[import] # pyright: ignore[reportMissingImports] -from twisted.python.failure import Failure # type: ignore[import] # pyright: ignore[reportMissingImports] +from twisted.internet.base import DelayedCall # type: ignore[import-not-found] # pyright: ignore[reportMissingImports] +from twisted.internet.defer import ( # type: ignore[import-not-found] # pyright: ignore[reportMissingImports] + Deferred, + DeferredQueue, +) +from twisted.internet.interfaces import ITransport # type: ignore[import-not-found] # pyright: ignore[reportMissingImports] +from twisted.internet.protocol import Protocol # type: ignore[import-not-found] # pyright: ignore[reportMissingImports] +from twisted.python.failure import Failure # type: ignore[import-not-found] # pyright: ignore[reportMissingImports] _T = TypeVar("_T") @@ -20,8 +23,8 @@ class ClosableDeferredQueue(DeferredQueue[_T], Generic[_T]): # pyright: ignore[ closed: Failure | BaseException | None def __init__(self, size: Incomplete | None = ..., backlog: Incomplete | None = ...) -> None: ... # Returns a Deferred with an error if fails. None if success - def put(self, obj: _T) -> Deferred[Failure | BaseException] | None: ... # type: ignore[override] - def get(self) -> Deferred[Failure | BaseException | _T]: ... # type: ignore[override] + def put(self, obj: _T) -> Deferred[Failure | BaseException] | None: ... # type: ignore[override] # ignore is not needed for mypy, but is for stubtest + def get(self) -> Deferred[Failure | BaseException | _T]: ... # type: ignore[override] # ignore is not needed for mypy, but is for stubtest pending: Incomplete def close(self, reason: BaseException | None) -> None: ... diff --git a/stubs/psycopg2/psycopg2/extensions.pyi b/stubs/psycopg2/psycopg2/extensions.pyi index a964f0ed5..77e120766 100644 --- a/stubs/psycopg2/psycopg2/extensions.pyi +++ b/stubs/psycopg2/psycopg2/extensions.pyi @@ -113,7 +113,7 @@ class NoneAdapter: def getquoted(self, _null: bytes = b"NULL") -> bytes: ... @overload -def make_dsn(dsn: bytes) -> bytes: ... # type: ignore[misc] +def make_dsn(dsn: bytes) -> bytes: ... # type: ignore[overload-overlap] @overload def make_dsn(dsn: None = None) -> str: ... @overload diff --git a/stubs/pycocotools/pycocotools/mask.pyi b/stubs/pycocotools/pycocotools/mask.pyi index 07d30d662..1571d7bd9 100644 --- a/stubs/pycocotools/pycocotools/mask.pyi +++ b/stubs/pycocotools/pycocotools/mask.pyi @@ -22,7 +22,7 @@ def merge(rleObjs: list[_EncodedRLE], intersect: int = ...) -> _EncodedRLE: ... # ignore an "overlapping overloads" error due to _NDArrayInt32 being an alias for `Incomplete` for now @overload -def frPyObjects(pyobj: _NDArrayUInt32 | list[list[int]] | list[_EncodedRLE], h: int, w: int) -> list[_EncodedRLE]: ... # type: ignore[misc] +def frPyObjects(pyobj: _NDArrayUInt32 | list[list[int]] | list[_EncodedRLE], h: int, w: int) -> list[_EncodedRLE]: ... # type: ignore[overload-overlap] @overload def frPyObjects(pyobj: list[int] | _EncodedRLE, h: int, w: int) -> _EncodedRLE: ... def encode(bimask: _NDArrayUInt8) -> _EncodedRLE: ... diff --git a/stubs/pyflakes/pyflakes/checker.pyi b/stubs/pyflakes/pyflakes/checker.pyi index 11262b692..76d9c89c8 100644 --- a/stubs/pyflakes/pyflakes/checker.pyi +++ b/stubs/pyflakes/pyflakes/checker.pyi @@ -39,11 +39,11 @@ _OmitType: TypeAlias = str | tuple[str, ...] | None def iter_child_nodes(node: ast.AST, omit: _OmitType = None, _fields_order: _FieldsOrder = ...) -> Iterator[ast.AST]: ... @overload -def convert_to_value(item: ast.Str) -> str: ... # type: ignore[misc] +def convert_to_value(item: ast.Str) -> str: ... # type: ignore[overload-overlap] @overload -def convert_to_value(item: ast.Bytes) -> bytes: ... # type: ignore[misc] +def convert_to_value(item: ast.Bytes) -> bytes: ... # type: ignore[overload-overlap] @overload -def convert_to_value(item: ast.Tuple) -> tuple[Any, ...]: ... # type: ignore[misc] +def convert_to_value(item: ast.Tuple) -> tuple[Any, ...]: ... # type: ignore[overload-overlap] @overload def convert_to_value(item: ast.Name | ast.NameConstant) -> Any: ... @overload diff --git a/stubs/pyinstaller/PyInstaller/building/api.pyi b/stubs/pyinstaller/PyInstaller/building/api.pyi index 3c44dfabc..afc53a69b 100644 --- a/stubs/pyinstaller/PyInstaller/building/api.pyi +++ b/stubs/pyinstaller/PyInstaller/building/api.pyi @@ -52,7 +52,7 @@ _HideConsole: TypeAlias = Literal["hide-early", "minimize-early", "hide-late", " class PYZ(Target): name: str cipher: _PyiBlockCipher - dependencies: list[_TOCTuple] # type: ignore[assignment] + dependencies: list[_TOCTuple] toc: list[_TOCTuple] code_dict: dict[str, CodeType] def __init__(self, *tocs: Iterable[_TOCTuple], name: str | None = None, cipher: _PyiBlockCipher = None) -> None: ... diff --git a/stubs/seaborn/seaborn/palettes.pyi b/stubs/seaborn/seaborn/palettes.pyi index 1bb1dfe57..480380b2b 100644 --- a/stubs/seaborn/seaborn/palettes.pyi +++ b/stubs/seaborn/seaborn/palettes.pyi @@ -38,7 +38,7 @@ _SeabornPaletteName: TypeAlias = Literal[ ] @overload -def color_palette( # type: ignore[misc] +def color_palette( # type: ignore[overload-overlap] palette: _SeabornPaletteName | None = None, n_colors: int | None = None, desat: float | None = None, *, as_cmap: Literal[True] ) -> list[str]: ... # this might be a bug in seaborn because we expect the return type to be a Colormap instance @overload diff --git a/stubs/seaborn/seaborn/utils.pyi b/stubs/seaborn/seaborn/utils.pyi index bb6378522..0a78fdc10 100644 --- a/stubs/seaborn/seaborn/utils.pyi +++ b/stubs/seaborn/seaborn/utils.pyi @@ -72,7 +72,7 @@ def locator_to_legend_entries( locator: Locator, limits: Iterable[float], dtype: Incomplete ) -> tuple[list[Incomplete], list[str]]: ... @overload -def relative_luminance(color: ColorType) -> float: ... # type: ignore[misc] +def relative_luminance(color: ColorType) -> float: ... # type: ignore[overload-overlap] @overload def relative_luminance(color: Sequence[ColorType]) -> NDArray[np.float64]: ... @overload diff --git a/stubs/setuptools/setuptools/command/upload_docs.pyi b/stubs/setuptools/setuptools/command/upload_docs.pyi index 5f923d96c..4ba859861 100644 --- a/stubs/setuptools/setuptools/command/upload_docs.pyi +++ b/stubs/setuptools/setuptools/command/upload_docs.pyi @@ -11,7 +11,7 @@ class upload_docs(upload): boolean_options: ClassVar[list[str]] def has_sphinx(self): ... # The callable parameter is self: Self, but using Self still trips up mypy - sub_commands: ClassVar[list[tuple[str, Callable[[Self], bool] | None]]] # type: ignore[misc, assignment] + sub_commands: ClassVar[list[tuple[str, Callable[[Self], bool] | None]]] # type: ignore[assignment] upload_dir: Any target_dir: Any def initialize_options(self) -> None: ... diff --git a/stubs/tqdm/tqdm/contrib/logging.pyi b/stubs/tqdm/tqdm/contrib/logging.pyi index fe8889002..3b5bfde1c 100644 --- a/stubs/tqdm/tqdm/contrib/logging.pyi +++ b/stubs/tqdm/tqdm/contrib/logging.pyi @@ -13,9 +13,7 @@ def logging_redirect_tqdm( ) -> _GeneratorContextManager[None]: ... # TODO type *args, **kwargs here more precisely -# The type ignore is because mypy complains that the second overload will never be matched -# (I'm not sure that's true) @overload def tqdm_logging_redirect(*args, tqdm_class: Callable[..., _TqdmT], **kwargs) -> _GeneratorContextManager[_TqdmT]: ... @overload -def tqdm_logging_redirect(*args, **kwargs) -> _GeneratorContextManager[std_tqdm[Incomplete]]: ... # type: ignore[misc] +def tqdm_logging_redirect(*args, **kwargs) -> _GeneratorContextManager[std_tqdm[Incomplete]]: ... diff --git a/stubs/uWSGI/uwsgi.pyi b/stubs/uWSGI/uwsgi.pyi index 7a7bd2dca..605ca56f2 100644 --- a/stubs/uWSGI/uwsgi.pyi +++ b/stubs/uWSGI/uwsgi.pyi @@ -87,7 +87,7 @@ def cache_update( def queue_get(__index: int) -> bytes | None: ... def queue_set(__index: int, __message: str | bytes | ReadOnlyBuffer) -> _TrueOrNone: ... @overload -def queue_last(__num: Literal[0] = 0) -> bytes | None: ... # type:ignore[misc] +def queue_last(__num: Literal[0] = 0) -> bytes | None: ... # type: ignore[overload-overlap] @overload def queue_last(__num: int) -> list[bytes | None]: ... def queue_push(__message: str | bytes | ReadOnlyBuffer) -> _TrueOrNone: ...