[ty] Use partially qualified names when reporting diagnostics regarding bad calls to methods#24560
[ty] Use partially qualified names when reporting diagnostics regarding bad calls to methods#24560AlexWaygood wants to merge 3 commits intomainfrom
Conversation
Typing conformance resultsThe percentage of diagnostics emitted that were expected errors held steady at 87.94%. The percentage of expected errors that received a diagnostic held steady at 83.21%. The number of fully passing files held steady at 79/133. SummaryHow are test cases classified?Each test case represents one expected error annotation or a group of annotations sharing a tag. Counts are per test case, not per diagnostic — multiple diagnostics on the same line count as one. Required annotations (
True positives changed (27)27 diagnostics
|
Memory usage reportMemory usage unchanged ✅ |
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
invalid-argument-type |
0 | 339 | 9,100 |
unknown-argument |
0 | 0 | 1,490 |
no-matching-overload |
111 | 0 | 1,160 |
too-many-positional-arguments |
0 | 0 | 407 |
missing-argument |
0 | 0 | 383 |
parameter-already-assigned |
0 | 0 | 35 |
positional-only-parameter-as-kwarg |
0 | 0 | 1 |
| Total | 111 | 339 | 12,576 |
Showing a random sample of 164 of 13026 changes. See the HTML report for the full diff.
Raw diff sample (164 of 13026 changes)
alerta (https://github.com/alerta/alerta)
- alerta/auth/decorators.py:51:47 error[invalid-argument-type] Argument to bound method `is_in_scope` is incorrect: Expected `str`, found `Unknown | None`
+ alerta/auth/decorators.py:51:47 error[invalid-argument-type] Argument to bound method `Permission.is_in_scope` is incorrect: Expected `str`, found `Unknown | None`
apprise (https://github.com/caronc/apprise)
- tests/test_api.py:881:31 error[invalid-argument-type] Argument to function `schemas` is incorrect: Expected `URLBase`, found `<class 'HtmlNotification'>`
+ tests/test_api.py:881:31 error[invalid-argument-type] Argument to function `URLBase.schemas` is incorrect: Expected `URLBase`, found `<class 'HtmlNotification'>`
- tests/test_escapes.py:231:21 error[invalid-argument-type] Argument to bound method `notify` is incorrect: Expected `str | bytes`, found `None`
+ tests/test_escapes.py:231:21 error[invalid-argument-type] Argument to bound method `Apprise.notify` is incorrect: Expected `str | bytes`, found `None`
- tests/test_plugin_custom_form.py:428:36 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | list[str | AttachBase | AppriseAttachment] | None`, found `tuple[str, str, str]`
+ tests/test_plugin_custom_form.py:428:36 error[invalid-argument-type] Argument to `AppriseAttachment.__init__` is incorrect: Expected `str | list[str | AttachBase | AppriseAttachment] | None`, found `tuple[str, str, str]`
- tests/test_plugin_xmpp.py:811:9 error[unknown-argument] Argument `secure` does not match any known parameter of bound method `__init__`
+ tests/test_plugin_xmpp.py:811:9 error[unknown-argument] Argument `secure` does not match any known parameter of `object.__init__`
- tests/test_plugin_xmpp.py:1825:9 error[unknown-argument] Argument `verify_certificate` does not match any known parameter of bound method `__init__`
+ tests/test_plugin_xmpp.py:1825:9 error[unknown-argument] Argument `verify_certificate` does not match any known parameter of `object.__init__`
- tests/test_plugin_xmpp.py:1965:9 error[unknown-argument] Argument `verify_certificate` does not match any known parameter of bound method `__init__`
+ tests/test_plugin_xmpp.py:1965:9 error[unknown-argument] Argument `verify_certificate` does not match any known parameter of `object.__init__`
- tests/test_plugin_xmpp.py:2191:9 error[unknown-argument] Argument `verify_certificate` does not match any known parameter of bound method `__init__`
+ tests/test_plugin_xmpp.py:2191:9 error[unknown-argument] Argument `verify_certificate` does not match any known parameter of `object.__init__`
bokeh (https://github.com/bokeh/bokeh)
- src/bokeh/models/glyphs.py:823:40 error[too-many-positional-arguments] Too many positional arguments to bound method `__init__`: expected 1, got 2
+ src/bokeh/models/glyphs.py:823:40 error[too-many-positional-arguments] Too many positional arguments to `LinearColorMapper.__init__`: expected 1, got 2
cloud-init (https://github.com/canonical/cloud-init)
- cloudinit/analyze/__init__.py:224:24 error[no-matching-overload] No overload of function `__new__` matches arguments
+ cloudinit/analyze/__init__.py:224:24 error[no-matching-overload] No overload of constructor `filter.__new__` matches arguments
core (https://github.com/home-assistant/core)
- homeassistant/components/media_player/__init__.py:1027:52 error[invalid-argument-type] Argument to bound method `async_add_executor_job` is incorrect: Expected `(...) -> Unknown`, found `object`
+ homeassistant/components/media_player/__init__.py:1027:52 error[invalid-argument-type] Argument to bound method `HomeAssistant.async_add_executor_job` is incorrect: Expected `(...) -> Unknown`, found `object`
- homeassistant/components/onvif/device.py:508:30 error[no-matching-overload] No overload of bound method `get` matches arguments
+ homeassistant/components/onvif/device.py:508:30 error[no-matching-overload] No overload of bound method `dict.get` matches arguments
- homeassistant/components/plex/media_browser.py:373:24 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bool`, found `Unknown | str | bool`
+ homeassistant/components/plex/media_browser.py:373:24 error[invalid-argument-type] Argument to `BrowseMedia.__init__` is incorrect: Expected `bool`, found `Unknown | str | bool`
- homeassistant/components/recorder/db_schema.py:676:13 error[unknown-argument] Argument `mean_weight` does not match any known parameter of bound method `__init__`
+ homeassistant/components/recorder/db_schema.py:676:13 error[unknown-argument] Argument `mean_weight` does not match any known parameter of `object.__init__`
- homeassistant/components/recorder/executor.py:54:19 error[invalid-argument-type] Argument to bound method `put` is incorrect: Expected `_WorkItem[Any]`, found `None`
+ homeassistant/components/recorder/executor.py:54:19 error[invalid-argument-type] Argument to bound method `SimpleQueue.put` is incorrect: Expected `_WorkItem[Any]`, found `None`
- homeassistant/util/hass_dict.pyi:165:18 error[invalid-argument-type] Argument to bound method `setdefault` is incorrect: Expected `str`, found `HassKey[int]`
+ homeassistant/util/hass_dict.pyi:165:18 error[invalid-argument-type] Argument to bound method `HassDict.setdefault` is incorrect: Expected `str`, found `HassKey[int]`
cryptography (https://github.com/pyca/cryptography)
- tests/hazmat/primitives/test_ec.py:200:43 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `EllipticCurvePublicNumbers`, found `None`
+ tests/hazmat/primitives/test_ec.py:200:43 error[invalid-argument-type] Argument to `EllipticCurvePrivateNumbers.__init__` is incorrect: Expected `EllipticCurvePublicNumbers`, found `None`
- tests/hazmat/primitives/test_ec.py:1059:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `KeySerializationEncryption`, found `Literal["notanencalg"]`
+ tests/hazmat/primitives/test_ec.py:1059:17 error[invalid-argument-type] Argument to bound method `EllipticCurvePrivateKey.private_bytes` is incorrect: Expected `KeySerializationEncryption`, found `Literal["notanencalg"]`
- tests/hazmat/primitives/test_ed448.py:208:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `KeySerializationEncryption`, found `None`
+ tests/hazmat/primitives/test_ed448.py:208:17 error[invalid-argument-type] Argument to bound method `Ed448PrivateKey.private_bytes` is incorrect: Expected `KeySerializationEncryption`, found `None`
- tests/hazmat/primitives/test_hpke.py:53:19 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `KEM`, found `Literal["not a kem"]`
+ tests/hazmat/primitives/test_hpke.py:53:19 error[invalid-argument-type] Argument to `Suite.__init__` is incorrect: Expected `KEM`, found `Literal["not a kem"]`
- tests/hazmat/primitives/test_kbkdf.py:702:17 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | None`, found `Literal[b"l"]`
+ tests/hazmat/primitives/test_kbkdf.py:702:17 error[invalid-argument-type] Argument to `KBKDFCMAC.__init__` is incorrect: Expected `int | None`, found `Literal[b"l"]`
- tests/hazmat/primitives/test_x25519.py:183:26 error[invalid-argument-type] Argument to bound method `exchange` is incorrect: Expected `X25519PublicKey`, found `object`
+ tests/hazmat/primitives/test_x25519.py:183:26 error[invalid-argument-type] Argument to bound method `X25519PrivateKey.exchange` is incorrect: Expected `X25519PublicKey`, found `object`
- tests/x509/test_x509.py:5462:17 error[invalid-argument-type] Argument to bound method `sign` is incorrect: Expected `PSS | PKCS1v15 | None`, found `Literal[b"notapadding"]`
+ tests/x509/test_x509.py:5462:17 error[invalid-argument-type] Argument to bound method `CertificateSigningRequestBuilder.sign` is incorrect: Expected `PSS | PKCS1v15 | None`, found `Literal[b"notapadding"]`
- tests/x509/test_x509_ext.py:7284:17 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Admission]`, found `list[None]`
+ tests/x509/test_x509_ext.py:7284:17 error[invalid-argument-type] Argument to `Admissions.__init__` is incorrect: Expected `Iterable[Admission]`, found `list[None]`
dd-trace-py (https://github.com/DataDog/dd-trace-py)
- benchmarks/recursive_computation/scenario.py:36:45 error[invalid-argument-type] Argument to bound method `set_tag` is incorrect: Expected `str | None`, found `int`
+ benchmarks/recursive_computation/scenario.py:36:45 error[invalid-argument-type] Argument to bound method `Span.set_tag` is incorrect: Expected `str | None`, found `int`
- ddtrace/appsec/_common_module_patches.py:195:45 error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `FrameType`, found `FrameType | None`
+ ddtrace/appsec/_common_module_patches.py:195:45 error[invalid-argument-type] Argument to constructor `TracebackType.__new__` is incorrect: Expected `FrameType`, found `FrameType | None`
- ddtrace/appsec/_iast/_ast/visitor.py:460:21 error[unknown-argument] Argument `col_offset` does not match any known parameter of bound method `__init__`
+ ddtrace/appsec/_iast/_ast/visitor.py:460:21 error[unknown-argument] Argument `col_offset` does not match any known parameter of `alias.__init__`
- ddtrace/contrib/internal/aiobotocore/patch.py:44:33 error[no-matching-overload] No overload of bound method `get` matches arguments
+ ddtrace/contrib/internal/aiobotocore/patch.py:44:33 error[no-matching-overload] No overload of bound method `Mapping.get` matches arguments
- ddtrace/contrib/internal/botocore/patch.py:109:39 error[no-matching-overload] No overload of bound method `get` matches arguments
+ ddtrace/contrib/internal/botocore/patch.py:109:39 error[no-matching-overload] No overload of bound method `Mapping.get` matches arguments
- ddtrace/contrib/internal/graphql/patch.py:71:34 error[no-matching-overload] No overload of bound method `get` matches arguments
+ ddtrace/contrib/internal/graphql/patch.py:71:34 error[no-matching-overload] No overload of bound method `Mapping.get` matches arguments
- ddtrace/contrib/internal/subprocess/patch.py:30:30 error[no-matching-overload] No overload of bound method `get` matches arguments
+ ddtrace/contrib/internal/subprocess/patch.py:30:30 error[no-matching-overload] No overload of bound method `Mapping.get` matches arguments
- ddtrace/debugging/_signal/snapshot.py:99:24 error[missing-argument] No argument provided for required parameter `self` of function `trickling`
+ ddtrace/debugging/_signal/snapshot.py:99:24 error[missing-argument] No argument provided for required parameter `self` of function `HourGlass.trickling`
- ddtrace/internal/ci_visibility/recorder.py:491:23 error[no-matching-overload] No overload of bound method `get` matches arguments
+ ddtrace/internal/ci_visibility/recorder.py:491:23 error[no-matching-overload] No overload of bound method `Mapping.get` matches arguments
- ddtrace/internal/telemetry/writer.py:383:46 error[invalid-argument-type] Argument to bound method `flush` is incorrect: Expected `int`, found `EnvVariable[int]`
+ ddtrace/internal/telemetry/writer.py:383:46 error[invalid-argument-type] Argument to bound method `HttpEndPointsCollection.flush` is incorrect: Expected `int`, found `EnvVariable[int]`
- ddtrace/vendor/psutil/setup.py:396:9 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | None`, found `bool | Unknown`
- tests/ci_visibility/test_encoder.py:629:40 error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `str | None`
+ tests/ci_visibility/test_encoder.py:629:40 error[invalid-argument-type] Argument to constructor `int.__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `str | None`
- tests/contrib/dbapi/test_dbapi.py:247:51 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Pin | None`, found `dict[Unknown, Unknown]`
+ tests/contrib/dbapi/test_dbapi.py:247:51 error[invalid-argument-type] Argument to `TracedCursor.__init__` is incorrect: Expected `Pin | None`, found `dict[Unknown, Unknown]`
- tests/contrib/grpc/test_grpc.py:637:17 error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str`, found `None`
+ tests/contrib/grpc/test_grpc.py:637:17 error[invalid-argument-type] Argument to constructor `SpanData.__new__` is incorrect: Expected `str`, found `None`
- tests/contrib/wsgi/test_wsgi.py:319:74 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bool`, found `None`
+ tests/contrib/wsgi/test_wsgi.py:319:74 error[invalid-argument-type] Argument to `_DDWSGIMiddlewareBase.__init__` is incorrect: Expected `bool`, found `None`
- tests/tracer/test_span.py:676:38 error[invalid-argument-type] Argument to bound method `set_exc_info` is incorrect: Expected `BaseException`, found `BaseException | None`
+ tests/tracer/test_span.py:676:38 error[invalid-argument-type] Argument to bound method `Span.set_exc_info` is incorrect: Expected `BaseException`, found `BaseException | None`
- tests/tracer/test_span_tags.py:120:25 error[invalid-argument-type] Argument to bound method `set_metric` is incorrect: Expected `int | float`, found `None | dict[Unknown, Unknown] | list[Unknown] | ... omitted 5 union elements`
+ tests/tracer/test_span_tags.py:120:25 error[invalid-argument-type] Argument to bound method `Span.set_metric` is incorrect: Expected `int | float`, found `None | dict[Unknown, Unknown] | list[Unknown] | ... omitted 5 union elements`
discord.py (https://github.com/Rapptz/discord.py)
- discord/ext/commands/flags.py:388:18 error[no-matching-overload] No overload of bound method `join` matches arguments
+ discord/ext/commands/flags.py:388:18 error[no-matching-overload] No overload of bound method `str.join` matches arguments
- discord/interactions.py:260:92 error[invalid-argument-type] Argument to bound method `format_map` is incorrect: Expected `_FormatMapMapping`, found `TextChannel | NewsChannel | VoiceChannel | ... omitted 7 union elements`
+ discord/interactions.py:260:92 error[invalid-argument-type] Argument to bound method `str.format_map` is incorrect: Expected `_FormatMapMapping`, found `TextChannel | NewsChannel | VoiceChannel | ... omitted 7 union elements`
- discord/state.py:1119:32 error[invalid-argument-type] Argument to function `store_user` is incorrect: Expected `Self@parse_guild_member_remove`, found `User`
+ discord/state.py:1119:32 error[invalid-argument-type] Argument to function `ConnectionState.store_user` is incorrect: Expected `Self@parse_guild_member_remove`, found `User`
graphql-core (https://github.com/graphql-python/graphql-core)
- src/graphql/language/parser.py:763:13 error[unknown-argument] Argument `description` does not match any known parameter of bound method `__init__`
+ src/graphql/language/parser.py:763:13 error[unknown-argument] Argument `description` does not match any known parameter of `object.__init__`
- src/graphql/utilities/value_from_ast.py:139:46 error[invalid-argument-type] Argument to function `parse_literal` is incorrect: Expected `GraphQLScalarType`, found `ValueNode & ~AlwaysFalsy & ~VariableNode & ~NullValueNode`
+ src/graphql/utilities/value_from_ast.py:139:46 error[invalid-argument-type] Argument to function `GraphQLScalarType.parse_literal` is incorrect: Expected `GraphQLScalarType`, found `ValueNode & ~AlwaysFalsy & ~VariableNode & ~NullValueNode`
- tests/utilities/test_type_info.py:346:25 error[unknown-argument] Argument `arguments` does not match any known parameter of bound method `__init__`
+ tests/utilities/test_type_info.py:346:25 error[unknown-argument] Argument `arguments` does not match any known parameter of `object.__init__`
hydpy (https://github.com/hydpy-dev/hydpy)
- hydpy/core/testtools.py:3118:9 error[invalid-argument-type] Argument to bound method `update_devices` is incorrect: Expected `Element | Iterable[Element | str] | None`, found `tuple[Device, Device, Device, Device, Device, Device, Device, Device, Device, Device, Device]`
+ hydpy/core/testtools.py:3118:9 error[invalid-argument-type] Argument to bound method `HydPy.update_devices` is incorrect: Expected `Element | Iterable[Element | str] | None`, found `tuple[Device, Device, Device, Device, Device, Device, Device, Device, Device, Device, Device]`
ibis (https://github.com/ibis-project/ibis)
- ibis/backends/athena/__init__.py:536:47 error[invalid-argument-type] Argument to bound method `compile` is incorrect: Expected `Mapping[Expr, Any] | None`, found `Mapping[Scalar, Any] | None`
+ ibis/backends/athena/__init__.py:536:47 error[invalid-argument-type] Argument to bound method `SQLBackend.compile` is incorrect: Expected `Mapping[Expr, Any] | None`, found `Mapping[Scalar, Any] | None`
- ibis/backends/pyspark/__init__.py:1183:66 error[invalid-argument-type] Argument to bound method `compile` is incorrect: Expected `int | None`, found `str | None`
+ ibis/backends/pyspark/__init__.py:1183:66 error[invalid-argument-type] Argument to bound method `SQLBackend.compile` is incorrect: Expected `int | None`, found `str | None`
- ibis/backends/sql/tests/test_compiler.py:17:17 error[positional-only-parameter-as-kwarg] Positional-only parameter 2 (`fraction`) passed as keyword argument of bound method `sample`
+ ibis/backends/sql/tests/test_compiler.py:17:17 error[positional-only-parameter-as-kwarg] Positional-only parameter 2 (`fraction`) passed as keyword argument of bound method `Table.sample`
- ibis/expr/types/core.py:425:32 error[invalid-argument-type] Argument to bound method `execute` is incorrect: Expected `Mapping[Scalar, Any] | None`, found `Mapping[Value, Any] | None`
+ ibis/expr/types/core.py:425:32 error[invalid-argument-type] Argument to bound method `BaseBackend.execute` is incorrect: Expected `Mapping[Scalar, Any] | None`, found `Mapping[Value, Any] | None`
- ibis/expr/types/relations.py:1640:56 error[invalid-argument-type] Argument to bound method `aggregate` is incorrect: Expected `Sequence[BooleanValue] | None`, found `(t) -> Unknown`
+ ibis/expr/types/relations.py:1640:56 error[invalid-argument-type] Argument to bound method `Table.aggregate` is incorrect: Expected `Sequence[BooleanValue] | None`, found `(t) -> Unknown`
- ibis/tests/expr/test_window_frames.py:253:9 error[parameter-already-assigned] Multiple values provided for parameter `how` of bound method `__init__`
+ ibis/tests/expr/test_window_frames.py:253:9 error[parameter-already-assigned] Multiple values provided for parameter `how` of `WindowFunction.__init__`
ignite (https://github.com/pytorch/ignite)
- tests/ignite/handlers/test_checkpoint.py:568:17 error[invalid-argument-type] Argument to bound method `__call__` is incorrect: Expected `Mapping[Unknown, Unknown]`, found `list[Unknown]`
+ tests/ignite/handlers/test_checkpoint.py:568:17 error[invalid-argument-type] Argument to bound method `ModelCheckpoint.__call__` is incorrect: Expected `Mapping[Unknown, Unknown]`, found `list[Unknown]`
- tests/ignite/handlers/test_early_stopping.py:151:7 error[invalid-argument-type] Argument to bound method `__call__` is incorrect: Expected `Engine`, found `None`
+ tests/ignite/handlers/test_early_stopping.py:151:7 error[invalid-argument-type] Argument to bound method `EarlyStopping.__call__` is incorrect: Expected `Engine`, found `None`
- tests/ignite/handlers/test_state_param_scheduler.py:358:32 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bool`, found `str | list[tuple[int, int]] | int | ... omitted 3 union elements`
+ tests/ignite/handlers/test_state_param_scheduler.py:358:32 error[invalid-argument-type] Argument to `LambdaStateScheduler.__init__` is incorrect: Expected `bool`, found `str | list[tuple[int, int]] | int | ... omitted 3 union elements`
jax (https://github.com/google/jax)
- jax/_src/core.py:655:35 error[invalid-argument-type] Argument to function `bind_with_trace` is incorrect: Expected `Primitive`, found `Trace | None`
+ jax/_src/core.py:655:35 error[invalid-argument-type] Argument to function `Primitive.bind_with_trace` is incorrect: Expected `Primitive`, found `Trace | None`
- jax/_src/pallas/fuser/block_spec.py:2576:33 error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Iterable[Element | Squeezed | Blocked | ... omitted 3 union elements]`, found `Sequence[Element | Squeezed | Blocked | ... omitted 3 union elements] | None`
+ jax/_src/pallas/fuser/block_spec.py:2576:33 error[invalid-argument-type] Argument to constructor `enumerate.__new__` is incorrect: Expected `Iterable[Element | Squeezed | Blocked | ... omitted 3 union elements]`, found `Sequence[Element | Squeezed | Blocked | ... omitted 3 union elements] | None`
manticore (https://github.com/trailofbits/manticore)
- manticore/core/state_pb2.py:355:25 error[invalid-argument-type] Argument to bound method `RegisterMessage` is incorrect: Expected `type[Message] | Message`, found `GeneratedProtocolMessageType`
+ manticore/core/state_pb2.py:355:25 error[invalid-argument-type] Argument to bound method `SymbolDatabase.RegisterMessage` is incorrect: Expected `type[Message] | Message`, found `GeneratedProtocolMessageType`
- manticore/wasm/executor.py:267:43 error[too-many-positional-arguments] Too many positional arguments to bound method `i32_rotl`: expected 3, got 4
+ manticore/wasm/executor.py:267:43 error[too-many-positional-arguments] Too many positional arguments to bound method `Executor.i32_rotl`: expected 3, got 4
- server/manticore_server/ManticoreServer_pb2.py:42:25 error[invalid-argument-type] Argument to bound method `RegisterMessage` is incorrect: Expected `type[Message] | Message`, found `GeneratedProtocolMessageType`
+ server/manticore_server/ManticoreServer_pb2.py:42:25 error[invalid-argument-type] Argument to bound method `SymbolDatabase.RegisterMessage` is incorrect: Expected `type[Message] | Message`, found `GeneratedProtocolMessageType`
meson (https://github.com/mesonbuild/meson)
- mesonbuild/backend/ninjabackend.py:2132:65 error[invalid-argument-type] Argument to function `_get_rust_dependency_name` is incorrect: Expected `SharedLibrary | StaticLibrary | CustomTarget | CustomTargetIndex`, found `BuildTarget | CustomTarget | CustomTargetIndex`
+ mesonbuild/backend/ninjabackend.py:2132:65 error[invalid-argument-type] Argument to function `NinjaBackend._get_rust_dependency_name` is incorrect: Expected `SharedLibrary | StaticLibrary | CustomTarget | CustomTargetIndex`, found `BuildTarget | CustomTarget | CustomTargetIndex`
- mesonbuild/backend/ninjabackend.py:2512:75 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `RSPFileSyntax`, found `bool | RSPFileSyntax`
+ mesonbuild/backend/ninjabackend.py:2512:75 error[invalid-argument-type] Argument to `NinjaRule.__init__` is incorrect: Expected `RSPFileSyntax`, found `bool | RSPFileSyntax`
- mesonbuild/compilers/detect.py:1380:35 error[invalid-argument-type] Argument to bound method `add_lang_args` is incorrect: Expected `Literal["c", "cpp", "cuda", "fortran", "d", ... omitted 11 literals]`, found `str`
+ mesonbuild/compilers/detect.py:1380:35 error[invalid-argument-type] Argument to bound method `Environment.add_lang_args` is incorrect: Expected `Literal["c", "cpp", "cuda", "fortran", "d", ... omitted 11 literals]`, found `str`
- mesonbuild/dependencies/python.py:429:24 error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | PathLike[str]`, found `str | None`
+ mesonbuild/dependencies/python.py:429:24 error[invalid-argument-type] Argument to constructor `Path.__new__` is incorrect: Expected `str | PathLike[str]`, found `str | None`
- mesonbuild/linkers/detect.py:83:63 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | list[str]`, found `None | str | list[str]`
+ mesonbuild/linkers/detect.py:83:63 error[invalid-argument-type] Argument to `ClangClDynamicLinker.__init__` is incorrect: Expected `str | list[str]`, found `None | str | list[str]`
- unittests/datatests.py:248:30 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Build`, found `FakeBuild`
+ unittests/datatests.py:248:30 error[invalid-argument-type] Argument to `Interpreter.__init__` is incorrect: Expected `Build`, found `FakeBuild`
mitmproxy (https://github.com/mitmproxy/mitmproxy)
- test/mitmproxy/proxy/layers/http/test_http.py:163:25 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Connection`, found `Server | _Placeholder[Server]`
+ test/mitmproxy/proxy/layers/http/test_http.py:163:25 error[invalid-argument-type] Argument to `ConnectionCommand.__init__` is incorrect: Expected `Connection`, found `Server | _Placeholder[Server]`
- test/mitmproxy/proxy/layers/http/test_http2.py:808:21 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Connection`, found `Server | _Placeholder[Server]`
+ test/mitmproxy/proxy/layers/http/test_http2.py:808:21 error[invalid-argument-type] Argument to `SendData.__init__` is incorrect: Expected `Connection`, found `Server | _Placeholder[Server]`
- test/mitmproxy/proxy/layers/http/test_http2.py:1286:29 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bytes`, found `bytes | _Placeholder[bytes]`
+ test/mitmproxy/proxy/layers/http/test_http2.py:1286:29 error[invalid-argument-type] Argument to `SendData.__init__` is incorrect: Expected `bytes`, found `bytes | _Placeholder[bytes]`
- test/mitmproxy/proxy/layers/test_modes.py:98:27 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Connection`, found `Server | _Placeholder[Server]`
+ test/mitmproxy/proxy/layers/test_modes.py:98:27 error[invalid-argument-type] Argument to `ConnectionCommand.__init__` is incorrect: Expected `Connection`, found `Server | _Placeholder[Server]`
- test/mitmproxy/proxy/layers/test_modes.py:102:31 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bytes`, found `bytes | _Placeholder[bytes]`
+ test/mitmproxy/proxy/layers/test_modes.py:102:31 error[invalid-argument-type] Argument to `SendData.__init__` is incorrect: Expected `bytes`, found `bytes | _Placeholder[bytes]`
- test/mitmproxy/test_types.py:158:43 error[invalid-argument-type] Argument to bound method `parse` is incorrect: Expected `Choice`, found `<class 'Marker'>`
+ test/mitmproxy/test_types.py:158:43 error[invalid-argument-type] Argument to bound method `_MarkerType.parse` is incorrect: Expected `Choice`, found `<class 'Marker'>`
optuna (https://github.com/optuna/optuna)
- tests/gp_tests/test_acqf.py:72:23 error[invalid-argument-type] Argument to bound method `update` is incorrect: Expected `GPRegressor | SearchSpace`, found `float`
+ tests/gp_tests/test_acqf.py:72:23 error[invalid-argument-type] Argument to bound method `MutableMapping.update` is incorrect: Expected `GPRegressor | SearchSpace`, found `float`
- tests/samplers_tests/test_nsgaii.py:857:40 error[invalid-argument-type] Argument to bound method `to_internal_repr` is incorrect: Expected `None | int | float | str`, found `ndarray[Unknown, dtype[Any]]`
+ tests/samplers_tests/test_nsgaii.py:857:40 error[invalid-argument-type] Argument to bound method `CategoricalDistribution.to_internal_repr` is incorrect: Expected `None | int | float | str`, found `ndarray[Unknown, dtype[Any]]`
pandas (https://github.com/pandas-dev/pandas)
- pandas/core/indexes/multi.py:4727:49 error[invalid-argument-type] Argument to bound method `from_tuples` is incorrect: Expected `Iterable[tuple[Hashable, ...]]`, found `(Unknown & ~Generator[object, None, None] & ~MultiIndex) | (list[object] & ~MultiIndex)`
+ pandas/core/indexes/multi.py:4727:49 error[invalid-argument-type] Argument to bound method `MultiIndex.from_tuples` is incorrect: Expected `Iterable[tuple[Hashable, ...]]`, found `(Unknown & ~Generator[object, None, None] & ~MultiIndex) | (list[object] & ~MultiIndex)`
- pandas/io/pytables.py:2040:55 error[invalid-argument-type] Argument to bound method `_create_storer` is incorrect: Expected `str`, found `Unknown | None`
+ pandas/io/pytables.py:2040:55 error[invalid-argument-type] Argument to bound method `HDFStore._create_storer` is incorrect: Expected `str`, found `Unknown | None`
- pandas/io/pytables.py:3231:35 error[invalid-argument-type] Argument to bound method `write_array` is incorrect: Expected `ExtensionArray | ndarray[tuple[Any, ...], dtype[Any]] | Index | Series`, found `Unknown | None`
+ pandas/io/pytables.py:3231:35 error[invalid-argument-type] Argument to bound method `GenericFixed.write_array` is incorrect: Expected `ExtensionArray | ndarray[tuple[Any, ...], dtype[Any]] | Index | Series`, found `Unknown | None`
- pandas/tests/arrays/sparse/test_libsparse.py:392:40 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ndarray[tuple[Any, ...], dtype[Any]]`, found `list[int]`
+ pandas/tests/arrays/sparse/test_libsparse.py:392:40 error[invalid-argument-type] Argument to `BlockIndex.__init__` is incorrect: Expected `ndarray[tuple[Any, ...], dtype[Any]]`, found `list[int]`
- pandas/tests/arrays/test_datetimes.py:655:30 error[invalid-argument-type] Argument to bound method `searchsorted` is incorrect: Expected `int | float | complex | ... omitted 7 union elements`, found `Period | Timestamp | Timedelta | NaTType`
+ pandas/tests/arrays/test_datetimes.py:655:30 error[invalid-argument-type] Argument to bound method `NDArrayBackedExtensionArray.searchsorted` is incorrect: Expected `int | float | complex | ... omitted 7 union elements`, found `Period | Timestamp | Timedelta | NaTType`
+ pandas/tests/frame/constructors/test_from_dict.py:82:13 error[no-matching-overload] No overload of `dict.__init__` matches arguments
- pandas/tests/frame/methods/test_dropna.py:274:33 error[invalid-argument-type] Argument to bound method `dropna` is incorrect: Expected `int | _NoDefault`, found `None`
+ pandas/tests/frame/methods/test_dropna.py:274:33 error[invalid-argument-type] Argument to bound method `DataFrame.dropna` is incorrect: Expected `int | _NoDefault`, found `None`
- pandas/tests/groupby/methods/test_quantile.py:102:51 error[invalid-argument-type] Argument to bound method `quantile` is incorrect: Expected `int | float | ExtensionArray | ... omitted 3 union elements`, found `list[int | float]`
+ pandas/tests/groupby/methods/test_quantile.py:102:51 error[invalid-argument-type] Argument to bound method `GroupBy.quantile` is incorrect: Expected `int | float | ExtensionArray | ... omitted 3 union elements`, found `list[int | float]`
- pandas/tests/io/json/test_pandas.py:543:44 error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | BaseOffset | _NoDefault`, found `None`
+ pandas/tests/io/json/test_pandas.py:543:44 error[invalid-argument-type] Argument to constructor `DatetimeIndex.__new__` is incorrect: Expected `str | BaseOffset | _NoDefault`, found `None`
- pandas/tests/io/parser/test_textreader.py:75:65 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bytes | str | None`, found `set[Unknown]`
- pandas/tests/io/parser/test_textreader.py:75:65 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `set[Unknown]`
- pandas/tests/io/parser/test_textreader.py:187:17 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `set[Unknown]`
- pandas/tests/io/test_stata.py:1044:39 error[invalid-argument-type] Argument to bound method `to_stata` is incorrect: Expected `dict[Hashable, str] | None`, found `dict[str, str]`
+ pandas/tests/io/test_stata.py:1044:39 error[invalid-argument-type] Argument to bound method `DataFrame.to_stata` is incorrect: Expected `dict[Hashable, str] | None`, found `dict[str, str]`
- pandas/tests/series/methods/test_reindex.py:387:29 error[parameter-already-assigned] Multiple values provided for parameter `index` of bound method `reindex`
+ pandas/tests/series/methods/test_reindex.py:387:29 error[parameter-already-assigned] Multiple values provided for parameter `index` of bound method `Series.reindex`
- pandas/tests/tseries/offsets/test_business_day.py:128:37 error[invalid-argument-type] Argument to bound method `rollforward` is incorrect: Expected `datetime`, found `date`
+ pandas/tests/tseries/offsets/test_business_day.py:128:37 error[invalid-argument-type] Argument to bound method `BaseOffset.rollforward` is incorrect: Expected `datetime`, found `date`
- pandas/tests/tseries/offsets/test_offsets.py:682:32 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bool`, found `int`
+ pandas/tests/tseries/offsets/test_offsets.py:682:32 error[invalid-argument-type] Argument to `RelativeDeltaOffset.__init__` is incorrect: Expected `bool`, found `int`
- pandas/tests/window/test_win_type.py:634:15 error[invalid-argument-type] Argument to bound method `mean` is incorrect: Expected `bool`, found `int | float`
+ pandas/tests/window/test_win_type.py:634:15 error[invalid-argument-type] Argument to bound method `Rolling.mean` is incorrect: Expected `bool`, found `int | float`
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- tests/frame/test_frame.py:2642:14 error[no-matching-overload] No overload of bound method `rename` matches arguments
+ tests/frame/test_frame.py:2642:14 error[no-matching-overload] No overload of bound method `DataFrame.rename` matches arguments
- tests/series/complex/test_mul.py:115:21 error[no-matching-overload] No overload of bound method `rmul` matches arguments
+ tests/series/complex/test_mul.py:115:21 error[no-matching-overload] No overload of bound method `Series.rmul` matches arguments
- tests/series/str/test_mul.py:115:9 error[no-matching-overload] No overload of bound method `rmul` matches arguments
+ tests/series/str/test_mul.py:115:9 error[no-matching-overload] No overload of bound method `Series.rmul` matches arguments
- tests/series/timedelta/test_sub.py:162:9 error[no-matching-overload] No overload of bound method `sub` matches arguments
+ tests/series/timedelta/test_sub.py:162:9 error[no-matching-overload] No overload of bound method `Series.sub` matches arguments
- tests/series/timedelta/test_truediv.py:88:23 error[no-matching-overload] No overload of bound method `rtruediv` matches arguments
+ tests/series/timedelta/test_truediv.py:88:23 error[no-matching-overload] No overload of bound method `Series.rtruediv` matches arguments
pandera (https://github.com/pandera-dev/pandera)
- tests/pandas/test_logical_dtypes.py:269:9 error[invalid-argument-type] Argument to bound method `check` is incorrect: Expected `pandera.engines.pandas_engine.DataType`, found `pandera.dtypes.DataType`
+ tests/pandas/test_logical_dtypes.py:269:9 error[invalid-argument-type] Argument to bound method `Decimal.check` is incorrect: Expected `pandera.engines.pandas_engine.DataType`, found `pandera.dtypes.DataType`
parso (https://github.com/davidhalter/parso)
- parso/pgen2/generator.py:279:20 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `None | str`
+ parso/pgen2/generator.py:279:20 error[invalid-argument-type] Argument to `Grammar.__init__` is incorrect: Expected `str`, found `None | str`
prefect (https://github.com/PrefectHQ/prefect)
- src/integrations/prefect-dbt/tests/core/test_orchestrator_cache.py:544:39 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | None`, found `object`
+ src/integrations/prefect-dbt/tests/core/test_orchestrator_cache.py:544:39 error[invalid-argument-type] Argument to `PrefectDbtOrchestrator.__init__` is incorrect: Expected `int | None`, found `object`
- src/prefect/task_engine.py:1762:47 error[invalid-argument-type] Argument to bound method `handle_success` is incorrect: Expected `R@run_generator_task_sync`, found `None`
+ src/prefect/task_engine.py:1762:47 error[invalid-argument-type] Argument to bound method `SyncTaskRunEngine.handle_success` is incorrect: Expected `R@run_generator_task_sync`, found `None`
pwndbg (https://github.com/pwndbg/pwndbg)
- pwndbg/aglib/disasm/disassembly.py:700:62 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Literal["x86-64", "i386", "i8086", "mips", "aarch64", ... omitted 9 literals]`, found `None`
+ pwndbg/aglib/disasm/disassembly.py:700:62 error[invalid-argument-type] Argument to `DisassemblyAssistant.__init__` is incorrect: Expected `Literal["x86-64", "i386", "i8086", "mips", "aarch64", ... omitted 9 literals]`, found `None`
- pwndbg/aglib/kernel/nftables.py:124:16 error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `Value | None`
+ pwndbg/aglib/kernel/nftables.py:124:16 error[invalid-argument-type] Argument to constructor `int.__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `Value | None`
pycryptodome (https://github.com/Legrandin/pycryptodome)
- lib/Crypto/SelfTest/Cipher/test_OCB.py:497:15 error[no-matching-overload] No overload of bound method `encrypt` matches arguments
+ lib/Crypto/SelfTest/Cipher/test_OCB.py:497:15 error[no-matching-overload] No overload of bound method `OcbMode.encrypt` matches arguments
pywin32 (https://github.com/mhammond/pywin32)
- win32/test/test_win32file.py:1010:28 error[invalid-argument-type] Argument to bound method `setblocking` is incorrect: Expected `bool`, found `Literal[0]`
+ win32/test/test_win32file.py:1010:28 error[invalid-argument-type] Argument to bound method `socket.setblocking` is incorrect: Expected `bool`, found `Literal[0]`
rich (https://github.com/Textualize/rich)
- tests/test_console.py:231:28 error[invalid-argument-type] Argument to bound method `print_json` is incorrect: Expected `str | None`, found `list[str]`
+ tests/test_console.py:231:28 error[invalid-argument-type] Argument to bound method `Console.print_json` is incorrect: Expected `str | None`, found `list[str]`
rotki (https://github.com/rotki/rotki)
- rotkehlchen/db/accounting_rules.py:581:9 error[invalid-argument-type] Argument to bound method `__call__` is incorrect: Expected `EvmEvent`, found `HistoryBaseEntry[Unknown]`
+ rotkehlchen/db/accounting_rules.py:581:9 error[invalid-argument-type] Argument to bound method `EventsAccountantCallback.__call__` is incorrect: Expected `EvmEvent`, found `HistoryBaseEntry[Unknown]`
- rotkehlchen/tasks/calendar.py:406:17 error[invalid-argument-type] Argument to bound method `create_or_update_calendar_entry_from_event` is incorrect: Expected `str`, found `str | None`
+ rotkehlchen/tasks/calendar.py:406:17 error[invalid-argument-type] Argument to bound method `CalendarReminderCreator.create_or_update_calendar_entry_from_event` is incorrect: Expected `str`, found `str | None`
- rotkehlchen/tests/db/test_history_events.py:103:17 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str`, found `EVMTxHash`
+ rotkehlchen/tests/db/test_history_events.py:103:17 error[invalid-argument-type] Argument to `HistoryEvent.__init__` is incorrect: Expected `str`, found `EVMTxHash`
- rotkehlchen/tests/exchanges/test_binance.py:58:47 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `DBHandler`, found `object`
+ rotkehlchen/tests/exchanges/test_binance.py:58:47 error[invalid-argument-type] Argument to `Binance.__init__` is incorrect: Expected `DBHandler`, found `object`
- rotkehlchen/tests/exchanges/test_bitfinex.py:131:59 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `MessagesAggregator`, found `object`
+ rotkehlchen/tests/exchanges/test_bitfinex.py:131:59 error[invalid-argument-type] Argument to `Bitfinex.__init__` is incorrect: Expected `MessagesAggregator`, found `object`
- rotkehlchen/tests/unit/decoders/test_main.py:457:9 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `float`
+ rotkehlchen/tests/unit/decoders/test_main.py:457:9 error[invalid-argument-type] Argument to `L2WithL1FeesTransaction.__init__` is incorrect: Expected `int`, found `float`
- rotkehlchen/tests/unit/decoders/test_paraswap.py:1227:9 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ChecksumAddress | None`, found `Literal["0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57"]`
+ rotkehlchen/tests/unit/decoders/test_paraswap.py:1227:9 error[invalid-argument-type] Argument to `EvmSwapEvent.__init__` is incorrect: Expected `ChecksumAddress | None`, found `Literal["0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57"]`
- rotkehlchen/tests/unit/decoders/test_zerox.py:1309:9 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ChecksumAddress | None`, found `Literal["0x000000000022D473030F116dDEE9F6B43aC78BA3"]`
+ rotkehlchen/tests/unit/decoders/test_zerox.py:1309:9 error[invalid-argument-type] Argument to `OnchainEvent.__init__` is incorrect: Expected `ChecksumAddress | None`, found `Literal["0x000000000022D473030F116dDEE9F6B43aC78BA3"]`
- rotkehlchen/tests/unit/test_eth2.py:519:9 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `int | None`
+ rotkehlchen/tests/unit/test_eth2.py:519:9 error[invalid-argument-type] Argument to `EthWithdrawalEvent.__init__` is incorrect: Expected `int`, found `int | None`
schemathesis (https://github.com/schemathesis/schemathesis)
- src/schemathesis/config/_error.py:119:31 error[no-matching-overload] No overload of bound method `join` matches arguments
+ src/schemathesis/config/_error.py:119:31 error[no-matching-overload] No overload of bound method `str.join` matches arguments
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- sklearn/decomposition/_dict_learning.py:140:23 error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | Buffer | SupportsFloat | SupportsIndex`, found `Unknown | None`
+ sklearn/decomposition/_dict_learning.py:140:23 error[invalid-argument-type] Argument to constructor `float.__new__` is incorrect: Expected `str | Buffer | SupportsFloat | SupportsIndex`, found `Unknown | None`
- sklearn/model_selection/tests/test_search.py:1388:18 error[no-matching-overload] No overload of bound method `repeat` matches arguments
+ sklearn/model_selection/tests/test_search.py:1388:18 error[no-matching-overload] No overload of bound method `ndarray.repeat` matches arguments
- sklearn/utils/validation.py:2521:13 error[invalid-argument-type] Argument to bound method `sort` is incorrect: Argument type `object` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
+ sklearn/utils/validation.py:2521:13 error[invalid-argument-type] Argument to bound method `list.sort` is incorrect: Argument type `object` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
scipy (https://github.com/scipy/scipy)
- benchmarks/benchmarks/sparse_linalg_lobpcg.py:163:42 error[unknown-argument] Argument `matvec` does not match any known parameter of bound method `__init__`
+ benchmarks/benchmarks/sparse_linalg_lobpcg.py:163:42 error[unknown-argument] Argument `matvec` does not match any known parameter of `LinearOperator.__init__`
- scipy/linalg/_decomp.py:478:44 error[no-matching-overload] No overload of bound method `join` matches arguments
+ scipy/linalg/_decomp.py:478:44 error[no-matching-overload] No overload of bound method `str.join` matches arguments
- scipy/optimize/_lsq/common.py:643:36 error[unknown-argument] Argument `matvec` does not match any known parameter of bound method `__init__`
+ scipy/optimize/_lsq/common.py:643:36 error[unknown-argument] Argument `matvec` does not match any known parameter of `LinearOperator.__init__`
- scipy/signal/tests/test_short_time_fft.py:439:37 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Literal["twosided", "centered", "onesided", "onesided2X"]`, found `int | str | None`
+ scipy/signal/tests/test_short_time_fft.py:439:37 error[invalid-argument-type] Argument to `ShortTimeFFT.__init__` is incorrect: Expected `Literal["twosided", "centered", "onesided", "onesided2X"]`, found `int | str | None`
- scipy/sparse/linalg/_interface.py:1230:32 error[unknown-argument] Argument `rmatvec` does not match any known parameter of bound method `__init__`
+ scipy/sparse/linalg/_interface.py:1230:32 error[unknown-argument] Argument `rmatvec` does not match any known parameter of `LinearOperator.__init__`
- scipy/spatial/transform/tests/test_rotation.py:1453:16 error[invalid-argument-type] Argument to bound method `mean` is incorrect: Expected `None | int | tuple[int, ...]`, found `Literal["0"]`
+ scipy/spatial/transform/tests/test_rotation.py:1453:16 error[invalid-argument-type] Argument to bound method `Rotation.mean` is incorrect: Expected `None | int | tuple[int, ...]`, found `Literal["0"]`
- scipy/stats/tests/test_sampling.py:557:17 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `TDRDist`, found `StandardNormal`
+ scipy/stats/tests/test_sampling.py:557:17 error[invalid-argument-type] Argument to `TransformedDensityRejection.__init__` is incorrect: Expected `TDRDist`, found `StandardNormal`
- scipy/stats/tests/test_sampling.py:1140:37 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | float`, found `Literal["ekki"]`
+ scipy/stats/tests/test_sampling.py:1140:37 error[invalid-argument-type] Argument to `NumericalInverseHermite.__init__` is incorrect: Expected `int | float`, found `Literal["ekki"]`
- scipy/stats/tests/test_stats.py:1381:18 error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `int`, found `float`
+ scipy/stats/tests/test_stats.py:1381:18 error[invalid-argument-type] Argument to bound method `list.append` is incorrect: Expected `int`, found `float`
scrapy (https://github.com/scrapy/scrapy)
- tests/test_mail.py:160:43 error[invalid-argument-type] Argument to bound method `_create_sender_factory` is incorrect: Expected `IO[bytes]`, found `Literal["test"]`
+ tests/test_mail.py:160:43 error[invalid-argument-type] Argument to bound method `MailSender._create_sender_factory` is incorrect: Expected `IO[bytes]`, found `Literal["test"]`
setuptools (https://github.com/pypa/setuptools)
- setuptools/_distutils/command/sdist.py:388:39 error[invalid-argument-type] Argument to bound method `exclude_pattern` is incorrect: Expected `str`, found `None`
+ setuptools/_distutils/command/sdist.py:388:39 error[invalid-argument-type] Argument to bound method `FileList.exclude_pattern` is incorrect: Expected `str`, found `None`
- setuptools/_distutils/compilers/C/base.py:1041:35 error[invalid-argument-type] Argument to function `_make_relative` is incorrect: Expected `Path`, found `PurePath`
+ setuptools/_distutils/compilers/C/base.py:1041:35 error[invalid-argument-type] Argument to function `Compiler._make_relative` is incorrect: Expected `Path`, found `PurePath`
spack (https://github.com/spack/spack)
- lib/spack/spack/vendor/ruamel/yaml/main.py:702:21 error[too-many-positional-arguments] Too many positional arguments to bound method `__init__`: expected 1, got 2
+ lib/spack/spack/vendor/ruamel/yaml/main.py:702:21 error[too-many-positional-arguments] Too many positional arguments to `object.__init__`: expected 1, got 2
- lib/spack/spack/vendor/typing_extensions.py:2607:9 error[too-many-positional-arguments] Too many positional arguments to bound method `__init__`: expected 1, got 2
+ lib/spack/spack/vendor/typing_extensions.py:2607:9 error[too-many-positional-arguments] Too many positional arguments to `object.__init__`: expected 1, got 2
static-frame (https://github.com/static-frame/static-frame)
- static_frame/core/container_util.py:504:17 error[invalid-argument-type] Argument to function `to_index` is incorrect: Expected `type[IndexBase]`, found `((...) -> IndexBase) | type[Index[Any]] | None`
+ static_frame/core/container_util.py:504:17 error[invalid-argument-type] Argument to function `IndexAutoConstructorFactory.to_index` is incorrect: Expected `type[IndexBase]`, found `((...) -> IndexBase) | type[Index[Any]] | None`
- static_frame/core/display_visidata.py:319:56 error[too-many-positional-arguments] Too many positional arguments to bound method `from_concat`: expected 2, got 3
+ static_frame/core/display_visidata.py:319:56 error[too-many-positional-arguments] Too many positional arguments to bound method `Frame.from_concat`: expected 2, got 3
- static_frame/core/interface.py:1541:61 error[invalid-argument-type] Argument to bound method `gen_from_display` is incorrect: Expected `str`, found `str | type[ContainerBase] | Any | int`
+ static_frame/core/interface.py:1541:61 error[invalid-argument-type] Argument to bound method `InterfaceRecord.gen_from_display` is incorrect: Expected `type[ContainerBase]`, found `str | type[ContainerBase] | Any | int`
- static_frame/test/unit/test_index_hierarchy.py:1877:39 error[invalid-argument-type] Argument to bound method `from_tree` is incorrect: Expected `dict[Hashable, Divergent]`, found `OrderedDict[str, OrderedDict[str, tuple[int, int]]]`
+ static_frame/test/unit/test_index_hierarchy.py:1877:39 error[invalid-argument-type] Argument to bound method `IndexHierarchy.from_tree` is incorrect: Expected `dict[Hashable, Divergent]`, found `OrderedDict[str, OrderedDict[str, tuple[int, int]]]`
- static_frame/test/unit/test_store.py:162:17 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `bool`, found `int | ((x) -> Unknown)`
+ static_frame/test/unit/test_store.py:162:17 error[invalid-argument-type] Argument to `StoreConfig.__init__` is incorrect: Expected `int | None`, found `int | ((x) -> Unknown)`
- static_frame/test/unit/test_type_clinic.py:1978:49 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[Hashable]`, found `EllipsisType`
+ static_frame/test/unit/test_type_clinic.py:1978:49 error[invalid-argument-type] Argument to `LabelsOrder.__init__` is incorrect: Expected `Sequence[Hashable]`, found `EllipsisType`
- static_frame/test/unit/test_type_clinic.py:2459:37 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[Hashable]`, found `Pattern[str]`
+ static_frame/test/unit/test_type_clinic.py:2459:37 error[invalid-argument-type] Argument to `LabelsMatch.__init__` is incorrect: Expected `Sequence[Hashable]`, found `Pattern[str]`
sympy (https://github.com/sympy/sympy)
- sympy/core/tests/test_args.py:3072:33 error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Boolean | bool`, found `Literal[1]`
+ sympy/core/tests/test_args.py:3072:33 error[invalid-argument-type] Argument to constructor `And.__new__` is incorrect: Expected `Boolean | bool`, found `Literal[1]`
- sympy/holonomic/holonomic.py:1043:59 error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Iterable[Unknown]`, found `Unknown | None`
+ sympy/holonomic/holonomic.py:1043:59 error[invalid-argument-type] Argument to constructor `enumerate.__new__` is incorrect: Expected `Iterable[Unknown]`, found `Unknown | None`
- sympy/polys/polyoptions.py:476:61 error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `Basic | int | float | complex | Any`
+ sympy/polys/polyoptions.py:476:61 error[invalid-argument-type] Argument to bound method `Domain.poly_ring` is incorrect: Expected `str | Expr`, found `Basic | int | float | complex | Any`
- sympy/polys/rootoftools.py:331:25 error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `(Unknown & ~None) | Basic`
+ sympy/polys/rootoftools.py:331:25 error[invalid-argument-type] Argument to constructor `int.__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `(Unknown & ~None) | Basic`
- sympy/printing/mathml.py:1291:26 error[invalid-argument-type] Argument to bound method `appendChild` is incorrect: Argument type `str` does not satisfy upper bound `Element | ProcessingInstruction | Comment | Text | DocumentFragment` of type variable `_ElementChildrenPlusFragment`
+ sympy/printing/mathml.py:1291:26 error[invalid-argument-type] Argument to bound method `Element.appendChild` is incorrect: Argument type `str` does not satisfy upper bound `Element | ProcessingInstruction | Comment | Text | DocumentFragment` of type variable `_ElementChildrenPlusFragment`
- sympy/solvers/tests/test_pde.py:130:22 error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(str, /) -> Unknown`, found `<class 'Function'>`
+ sympy/solvers/tests/test_pde.py:130:22 error[invalid-argument-type] Argument to constructor `map.__new__` is incorrect: Expected `(str, /) -> Unknown`, found `<class 'Function'>`
- sympy/testing/runtests.py:1191:36 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[expr]`, found `list[Name]`
+ sympy/testing/runtests.py:1191:36 error[invalid-argument-type] Argument to `Tuple.__init__` is incorrect: Expected `list[expr]`, found `list[Name]`
trio (https://github.com/python-trio/trio)
- src/trio/_tests/test_testing_raisesgroup.py:993:17 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `type[BaseException]`, found `<class 'object'>`
+ src/trio/_tests/test_testing_raisesgroup.py:993:17 error[invalid-argument-type] Argument to `Matcher.__init__` is incorrect: Expected `type[BaseException]`, found `<class 'object'>`
vision (https://github.com/pytorch/vision)
- test/test_transforms_v2.py:1746:45 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `InterpolationMode | int`, found `int | tuple[int | float, int | float] | tuple[int, int, int, int]`
+ test/test_transforms_v2.py:1746:45 error[invalid-argument-type] Argument to `RandomAffine.__init__` is incorrect: Expected `InterpolationMode | int`, found `int | tuple[int | float, int | float] | tuple[int, int, int, int]`
- test/test_transforms_v2.py:3734:45 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | Sequence[int] | None`, found `list[int | float]`
+ test/test_transforms_v2.py:3734:45 error[invalid-argument-type] Argument to `RandomCrop.__init__` is incorrect: Expected `int | Sequence[int] | None`, found `list[int | float]`
werkzeug (https://github.com/pallets/werkzeug)
- src/werkzeug/datastructures/headers.py:518:51 error[invalid-argument-type] Argument to bound method `getlist` is incorrect: Expected `str`, found `object`
+ src/werkzeug/datastructures/headers.py:518:51 error[invalid-argument-type] Argument to bound method `MultiDict.getlist` is incorrect: Expected `Never`, found `object`
- tests/middleware/test_shared_data.py:10:32 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `(dict[str, Any], StartResponse, /) -> Iterable[bytes]`, found `None`
+ tests/middleware/test_shared_data.py:10:32 error[invalid-argument-type] Argument to `SharedDataMiddleware.__init__` is incorrect: Expected `(dict[str, Any], StartResponse, /) -> Iterable[bytes]`, found `None`
- tests/test_datastructures.py:952:44 error[invalid-argument-type] Argument to bound method `best_match` is incorrect: Expected `str`, found `None`
+ tests/test_datastructures.py:952:44 error[invalid-argument-type] Argument to bound method `Accept.best_match` is incorrect: Expected `str`, found `None`
- tests/test_routing.py:584:13 error[invalid-argument-type] Argument to bound method `force_type` is incorrect: Expected `Response`, found `(dict[str, Any], StartResponse, /) -> Iterable[bytes]`
+ tests/test_routing.py:584:13 error[invalid-argument-type] Argument to bound method `Response.force_type` is incorrect: Expected `Response`, found `(dict[str, Any], StartResponse, /) -> Iterable[bytes]`
xarray (https://github.com/pydata/xarray)
- xarray/core/groupby.py:502:36 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Argument type `T_DataWithCoords@_resolve_group` does not satisfy constraints (`DataArray`, `Dataset`) of type variable `T_Xarray`
+ xarray/core/groupby.py:502:36 error[invalid-argument-type] Argument to `_DummyGroup.__init__` is incorrect: Argument type `T_DataWithCoords@_resolve_group` does not satisfy constraints (`DataArray`, `Dataset`) of type variable `T_Xarray`
- xarray/tests/test_backends.py:3863:38 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `MutableMapping[str, bool | dict[str, dict[str, int]]]`, found `dict[str, dict[str, dict[str, int]]]`
+ xarray/tests/test_backends.py:3863:38 error[invalid-argument-type] Argument to `ChainMap.__init__` is incorrect: Expected `MutableMapping[str, bool | dict[str, dict[str, int]]]`, found `dict[str, dict[str, dict[str, int]]]`
- xarray/tests/test_dataarray.py:2379:49 error[invalid-argument-type] Argument to bound method `get_level_values` is incorrect: Expected `str | int`, found `Hashable`
+ xarray/tests/test_dataarray.py:2379:49 error[invalid-argument-type] Argument to bound method `MultiIndex.get_level_values` is incorrect: Expected `str | int`, found `Hashable`
- xarray/tests/test_plot.py:263:17 error[missing-argument] No argument provided for required parameter `self` of bound method `__call__`
+ xarray/tests/test_plot.py:263:17 error[missing-argument] No argument provided for required parameter `self` of bound method `_Wrapped.__call__`
- xarray/tests/test_plot.py:654:13 error[missing-argument] No argument provided for required parameter `self` of bound method `__call__`
+ xarray/tests/test_plot.py:654:13 error[missing-argument] No argument provided for required parameter `self` of bound method `_Wrapped.__call__`
yarl (https://github.com/aio-libs/yarl)
- tests/test_url.py:1816:13 error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str | SplitResult | URL | UndefinedType`, found `Literal[1234]`
+ tests/test_url.py:1816:13 error[invalid-argument-type] Argument to constructor `URL.__new__` is incorrect: Expected `str | SplitResult | URL | UndefinedType`, found `Literal[1234]`
zulip (https://github.com/zulip/zulip)
- zerver/tests/test_decorators.py:1031:13 error[unknown-argument] Argument `post_data` does not match any known parameter of function `__new__`
+ zerver/tests/test_decorators.py:1031:13 error[unknown-argument] Argument `post_data` does not match any known parameter of constructor `HttpRequest.__new__`
- zerver/tests/test_import_export.py:3166:17 error[unknown-argument] Argument `sender` does not match any known parameter of bound method `__init__`
+ zerver/tests/test_import_export.py:3166:17 error[unknown-argument] Argument `sender` does not match any known parameter of `object.__init__`
- zerver/tests/test_typed_endpoint.py:618:17 error[unknown-argument] Argument `input_data` does not match any known parameter of bound method `__init__`
+ zerver/tests/test_typed_endpoint.py:618:17 error[unknown-argument] Argument `input_data` does not match any known parameter of `object.__init__`| # error: [too-many-positional-arguments] "Too many positional arguments to bound method `__init__`: expected 1, got 2" | ||
| # error: [too-many-positional-arguments] "Too many positional arguments to `object.__init__`: expected 1, got 2" | ||
| reveal_type(Foo(1)) # revealed: Foo |
There was a problem hiding this comment.
Describing __init__ as a "bound method" in this case is technically accurate, but not at all how most Python users would think about this constructor call, since a "bound method" implies (accurately) that the method is already bound to a constructed instance -- but from the user's perspective, the instance has yet to be created!
It's tempting to describe it as a "constructor" rather than a "bound method", but that's not technically accurate; the method is called on an instance after the instance has been constructed by __new__.
I wondered about describing it as an "initializer", but "Too many positional arguments to initializer object.__init__" feels very silly, given that the name __init__ already clearly signals that the method initializes the instance.
Ultimately, I decided to omit the description entirely for this common case: I think nearly all Python users will understand that an __init__ method is implicitly called when they construct an instance. I don't think any of the descriptions "bound method", "constructor" or "initializer" add any clarity; it's better to just keep the diagnostic more concise here.
|
I assume that ecosystem-analyzer is just struggling with the diff here because it's so huge. I don't think there's any way that this PR could really have resulted in 340 |
77bdedd to
e46f71b
Compare
|
Right, but I just don't see how this diff could possibly result in any diagnostics being added or going away... |

Summary
Currently if you do this:
Our concise diagnostic is this:
Which is a bit baffling for a user. What
__init__method, defined on which superclass?If you use our default output format, we tell you which file and line the
__init__method is defined in, but it's still pretty hard to figure out what class that method is defined in unless you're in an IDE and can jump there:This PR adjusts our call-binding machinery to use partially qualified names when reporting bad calls to methods. I think this makes our diagnostics significantly more comprehensible, and helps a lot with astral-sh/ty#2482. It should also hopefully make some of the diagnostics in #24550 less bafflingly worded.
Test Plan
mdtests and snapshots updated.