Skip to content

[ty] Narrow bound method overloads by receiver#24707

Merged
charliermarsh merged 22 commits into
mainfrom
charlie/bind-selfs
May 30, 2026
Merged

[ty] Narrow bound method overloads by receiver#24707
charliermarsh merged 22 commits into
mainfrom
charlie/bind-selfs

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Apr 18, 2026

Copy link
Copy Markdown
Member

Summary

Given:

from typing import overload

class Base:
    @overload
    def convert(self: "Base", x: int) -> int: ...

    @overload
    def convert(self: "Child", x: str) -> str: ...

    def convert(self, x: int | str) -> int | str:
        return x

class Child(Base): ...

On main, we treat Base().convert as if both overloads are still possible, including the overload that requires self: "Child".

After this PR:

reveal_type(Base().convert)
# bound method Base.convert(x: int) -> int

reveal_type(Child().convert)
# Overload[(x: int) -> int, (x: str) -> str]

So Base().convert("x") is no longer considered valid via narrowing on the actual receiver type.

Closes astral-sh/ty#2693.

Closes astral-sh/ty#2612.

Closes astral-sh/ty#3380.

Closes astral-sh/ty#1169.

@astral-sh-bot astral-sh-bot Bot added the ty Multi-file analysis & type inference label Apr 18, 2026
@astral-sh-bot

astral-sh-bot Bot commented Apr 18, 2026

Copy link
Copy Markdown

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 91.94%. The percentage of expected errors that received a diagnostic held steady at 87.09%. The number of fully passing files held steady at 92/134.

@astral-sh-bot

astral-sh-bot Bot commented Apr 18, 2026

Copy link
Copy Markdown

Memory usage report

Summary

Project Old New Diff Outcome
sphinx 261.23MB 261.68MB +0.17% (462.61kB)
prefect 710.83MB 711.23MB +0.06% (409.47kB)
trio 109.32MB 109.43MB +0.10% (113.41kB)
flake8 43.97MB 44.01MB +0.08% (38.07kB)

Significant changes

Click to expand detailed breakdown

sphinx

Name Old New Diff Outcome
BoundMethodType<'db>::bound_signatures_ 0.00B 619.52kB +619.52kB (new)
when_constraint_set_assignable_to_owned_impl 2.45MB 2.41MB -1.73% (43.54kB)
BoundMethodType<'db>::into_callable_type_ 252.41kB 210.57kB -16.57% (41.84kB)
infer_expression_types_impl 21.98MB 21.96MB -0.11% (23.74kB)
infer_definition_types 23.94MB 23.93MB -0.06% (15.39kB)
infer_scope_types_impl 13.47MB 13.46MB -0.06% (8.66kB)
infer_statement_types_impl 565.09kB 562.02kB -0.54% (3.07kB)
CallableType 1.36MB 1.36MB -0.21% (2.95kB)
Type<'db>::try_call_dunder_get_ 5.11MB 5.11MB -0.06% (2.92kB)
Type<'db>::member_lookup_with_policy_ 7.28MB 7.28MB -0.02% (1.73kB)
infer_expression_type_impl 3.01MB 3.01MB -0.04% (1.34kB)
Type<'db>::class_member_with_policy_ 7.94MB 7.94MB -0.01% (1.11kB)
is_redundant_with_impl 992.10kB 991.25kB -0.09% (864.00B)
Specialization 1.28MB 1.28MB -0.06% (816.00B)
Type<'db>::class_member_with_policy_::interned_arguments 4.21MB 4.21MB -0.02% (728.00B)
... 33 more

prefect

Name Old New Diff Outcome
BoundMethodType<'db>::bound_signatures_ 0.00B 664.14kB +664.14kB (new)
when_constraint_set_assignable_to_owned_impl 4.95MB 4.88MB -1.37% (69.63kB)
BoundMethodType<'db>::into_callable_type_ 287.31kB 219.76kB -23.51% (67.55kB)
infer_expression_types_impl 60.41MB 60.36MB -0.07% (43.90kB)
infer_definition_types 89.76MB 89.74MB -0.03% (23.97kB)
CallableType 2.79MB 2.78MB -0.42% (12.03kB)
infer_scope_types_impl 50.86MB 50.85MB -0.02% (10.32kB)
infer_expression_type_impl 8.23MB 8.22MB -0.11% (9.29kB)
Type<'db>::try_call_dunder_get_ 11.52MB 11.52MB -0.06% (7.29kB)
Type<'db>::apply_specialization_ 3.55MB 3.55MB +0.20% (7.13kB)
Type<'db>::apply_specialization_::interned_arguments 3.54MB 3.55MB +0.15% (5.55kB)
is_redundant_with_impl 2.16MB 2.15MB -0.13% (2.81kB)
all_narrowing_constraints_for_expression 6.79MB 6.79MB -0.04% (2.44kB)
all_negative_narrowing_constraints_for_expression 6.62MB 6.62MB -0.04% (2.39kB)
StaticClassLiteral<'db>::try_mro_ 5.34MB 5.34MB -0.04% (2.09kB)
... 29 more

trio

Name Old New Diff Outcome
BoundMethodType<'db>::bound_signatures_ 0.00B 141.93kB +141.93kB (new)
BoundMethodType<'db>::into_callable_type_ 66.04kB 51.35kB -22.24% (14.68kB)
when_constraint_set_assignable_to_owned_impl 630.57kB 625.05kB -0.88% (5.53kB)
infer_expression_types_impl 6.75MB 6.75MB -0.07% (4.52kB)
infer_definition_types 7.69MB 7.69MB -0.02% (1.57kB)
Type<'db>::try_call_dunder_get_ 1.31MB 1.31MB -0.08% (1.02kB)
infer_scope_types_impl 4.14MB 4.13MB -0.02% (684.00B)
Type<'db>::apply_specialization_::interned_arguments 630.08kB 630.62kB +0.09% (560.00B)
Type<'db>::apply_specialization_ 624.72kB 625.27kB +0.09% (560.00B)
is_redundant_with_impl 194.95kB 194.41kB -0.28% (552.00B)
cached_protocol_interface 142.54kB 142.98kB +0.31% (456.00B)
infer_expression_type_impl 1.36MB 1.36MB -0.03% (432.00B)
CallableType 692.66kB 692.96kB +0.04% (304.00B)
ClassType<'db>::into_callable_ 3.13kB 2.87kB -8.24% (264.00B)
loop_header_reachability 133.17kB 132.91kB -0.19% (264.00B)
... 13 more

flake8

Name Old New Diff Outcome
BoundMethodType<'db>::bound_signatures_ 0.00B 50.36kB +50.36kB (new)
BoundMethodType<'db>::into_callable_type_ 21.26kB 16.65kB -21.66% (4.61kB)
when_constraint_set_assignable_to_owned_impl 261.90kB 258.46kB -1.31% (3.44kB)
infer_expression_types_impl 1.09MB 1.09MB -0.15% (1.66kB)
infer_definition_types 1.84MB 1.84MB -0.05% (900.00B)
CallableType 206.03kB 205.67kB -0.17% (368.00B)
infer_statement_types_impl 51.02kB 50.73kB -0.57% (300.00B)
Specialization 178.64kB 178.41kB -0.13% (240.00B)
Type<'db>::try_call_dunder_get_ 378.89kB 378.67kB -0.06% (228.00B)
infer_scope_types_impl 871.58kB 871.37kB -0.02% (216.00B)
UnionType<'db>::from_two_elements_ 33.97kB 33.79kB -0.53% (184.00B)
UnionType<'db>::from_two_elements_::interned_arguments 33.00kB 32.83kB -0.52% (176.00B)
infer_deferred_types 513.22kB 513.11kB -0.02% (120.00B)
Type<'db>::apply_specialization_ 211.75kB 211.85kB +0.05% (104.00B)
Type<'db>::apply_specialization_::interned_arguments 221.64kB 221.72kB +0.04% (80.00B)
... 2 more

@astral-sh-bot

astral-sh-bot Bot commented Apr 18, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

Lint rule Added Removed Changed
type-assertion-failure 28 266 81
invalid-argument-type 1 13 294
unsupported-operator 15 94 0
no-matching-overload 17 59 0
invalid-method-override 27 40 0
unused-ignore-comment 12 0 0
invalid-assignment 0 1 2
invalid-return-type 0 2 0
Total 100 475 377

Large timing changes:

Project Old Time New Time Change
colour 1.70s 6.12s +260%
pandas-stubs 8.75s 3.18s -64%

Showing a random sample of 159 of 952 changes. See the HTML report for the full diff.

Raw diff sample (159 of 952 changes)
apprise (https://github.com/caronc/apprise)
- apprise/config/base.py:823:38 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["tag"]` on object of type `str`
+ apprise/config/base.py:823:38 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["tag"]` on object of type `str`
- apprise/config/base.py:825:21 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["tag"]` on object of type `str`
+ apprise/config/base.py:825:21 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["tag"]` on object of type `str`
- apprise/plugins/whatsapp.py:442:25 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["components"]` on object of type `str`
+ apprise/plugins/whatsapp.py:442:25 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["components"]` on object of type `str`

cloud-init (https://github.com/canonical/cloud-init)
- cloudinit/netinfo.py:279:25 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["ip"]` on object of type `str`
+ cloudinit/netinfo.py:279:25 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["ip"]` on object of type `str`
- cloudinit/sources/DataSourceAzure.py:1618:21 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["network"]` on object of type `str`
+ cloudinit/sources/DataSourceAzure.py:1618:21 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["network"]` on object of type `str`
- cloudinit/sources/DataSourceNoCloud.py:172:24 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["seedfrom"]` on object of type `str`
+ cloudinit/sources/DataSourceNoCloud.py:172:24 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["seedfrom"]` on object of type `str`
- cloudinit/sources/DataSourceVMware.py:1017:20 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["ip"]` on object of type `str`
+ cloudinit/sources/DataSourceVMware.py:1017:20 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["ip"]` on object of type `str`
- cloudinit/sources/helpers/openstack.py:300:27 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["random_seed"]` on object of type `str`
+ cloudinit/sources/helpers/openstack.py:300:27 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["random_seed"]` on object of type `str`
- tests/unittests/sources/test_azure.py:1640:9 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["ipAddress"]` on object of type `str`
+ tests/unittests/sources/test_azure.py:1640:9 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["ipAddress"]` on object of type `str`
- tests/unittests/sources/test_cloudsigma.py:103:37 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["cloudinit"]` on object of type `str`
+ tests/unittests/sources/test_cloudsigma.py:103:37 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["cloudinit"]` on object of type `str`
- tests/unittests/sources/test_gce.py:163:13 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["user-data"]` on object of type `str`
+ tests/unittests/sources/test_gce.py:163:13 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["user-data"]` on object of type `str`
- tests/unittests/test_ds_identify.py:1123:21 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["sys/class/dmi/id/product_name"]` on object of type `str`
+ tests/unittests/test_ds_identify.py:1123:21 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["sys/class/dmi/id/product_name"]` on object of type `str`
- tests/unittests/test_ds_identify.py:1343:36 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["usr/lib/vmware-tools/plugins/vmsvc/libdeployPkgPlugin.so"]` on object of type `str`
+ tests/unittests/test_ds_identify.py:1343:36 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["usr/lib/vmware-tools/plugins/vmsvc/libdeployPkgPlugin.so"]` on object of type `str`

core (https://github.com/home-assistant/core)
- homeassistant/components/forked_daapd/media_player.py:413:32 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["volume"]` on object of type `str`
+ homeassistant/components/forked_daapd/media_player.py:413:32 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["volume"]` on object of type `str`
- homeassistant/components/forked_daapd/media_player.py:428:16 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["selected"]` on object of type `str`
+ homeassistant/components/forked_daapd/media_player.py:428:16 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["selected"]` on object of type `str`
- homeassistant/components/forked_daapd/media_player.py:480:16 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["media_kind"]` on object of type `str`
+ homeassistant/components/forked_daapd/media_player.py:480:16 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["media_kind"]` on object of type `str`
- homeassistant/components/forked_daapd/media_player.py:503:20 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["album"]` on object of type `str`
+ homeassistant/components/forked_daapd/media_player.py:503:20 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["album"]` on object of type `str`
- homeassistant/components/forked_daapd/media_player.py:509:16 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["artist"]` on object of type `str`
+ homeassistant/components/forked_daapd/media_player.py:509:16 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["artist"]` on object of type `str`
- homeassistant/components/forked_daapd/media_player.py:516:12 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["data_kind"]` on object of type `str`
+ homeassistant/components/forked_daapd/media_player.py:516:12 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["data_kind"]` on object of type `str`
- homeassistant/components/forked_daapd/media_player.py:630:25 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["id"]` on object of type `str`
+ homeassistant/components/forked_daapd/media_player.py:630:25 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["id"]` on object of type `str`
- homeassistant/helpers/storage.py:444:17 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["version"]` on object of type `str`
+ homeassistant/helpers/storage.py:444:17 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["version"]` on object of type `str`
- homeassistant/helpers/storage.py:450:74 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["data"]` on object of type `str`
+ homeassistant/helpers/storage.py:450:74 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["data"]` on object of type `str`
- homeassistant/helpers/storage.py:454:42 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["minor_version"]` on object of type `str`
+ homeassistant/helpers/storage.py:454:42 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["minor_version"]` on object of type `str`

cwltool (https://github.com/common-workflow-language/cwltool)
- cwltool/checker.py:115:39 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["type"]` on object of type `str`
+ cwltool/checker.py:115:39 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["type"]` on object of type `str`
- cwltool/checker.py:121:12 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["type"]` on object of type `str`
+ cwltool/checker.py:121:12 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["type"]` on object of type `str`
- cwltool/main.py:296:27 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["type"]` on object of type `str`
+ cwltool/main.py:296:27 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["type"]` on object of type `str`
- cwltool/main.py:300:74 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["type"]` on object of type `str`
+ cwltool/main.py:300:74 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["type"]` on object of type `str`
- cwltool/main.py:304:27 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["type"]` on object of type `str`
+ cwltool/main.py:304:27 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["type"]` on object of type `str`
- cwltool/main.py:310:58 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["items"]` on object of type `str`
+ cwltool/main.py:310:58 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["items"]` on object of type `str`
- cwltool/pack.py:33:40 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["run"]` on object of type `str`
+ cwltool/pack.py:33:40 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["run"]` on object of type `str`
- cwltool/pack.py:48:35 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["id"]` on object of type `str`
+ cwltool/pack.py:48:35 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["id"]` on object of type `str`
- cwltool/process.py:1069:58 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["requirements"]` on object of type `str`
+ cwltool/process.py:1069:58 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["requirements"]` on object of type `str`
- cwltool/process.py:1071:37 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["requirements"]` on object of type `str`
+ cwltool/process.py:1071:37 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["requirements"]` on object of type `str`
- tests/test_examples.py:363:12 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["checksum"]` on object of type `str`
+ tests/test_examples.py:363:12 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["checksum"]` on object of type `str`

dd-trace-py (https://github.com/DataDog/dd-trace-py)
- tests/contrib/litellm/test_litellm_llmobs.py:142:31 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["parameters"]` on object of type `str`
+ tests/contrib/litellm/test_litellm_llmobs.py:142:31 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["parameters"]` on object of type `str`
- tests/contrib/vertexai/test_vertexai_llmobs.py:390:46 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["location"]` on object of type `str`
+ tests/contrib/vertexai/test_vertexai_llmobs.py:390:46 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["location"]` on object of type `str`
- tests/contrib/vertexai/test_vertexai_llmobs.py:841:25 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["parts"]` on object of type `str`
+ tests/contrib/vertexai/test_vertexai_llmobs.py:841:25 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["parts"]` on object of type `str`
- tests/debugging/probe/test_status.py:16:34 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["event"]` on object of type `str`
+ tests/debugging/probe/test_status.py:16:34 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["event"]` on object of type `str`
- tests/llmobs/test_experiments.py:3746:12 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["tags"]` on object of type `str`
+ tests/llmobs/test_experiments.py:3746:12 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["tags"]` on object of type `str`
- tests/llmobs/test_experiments.py:4682:12 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["id"]` on object of type `str`
+ tests/llmobs/test_experiments.py:4682:12 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["id"]` on object of type `str`

freqtrade (https://github.com/freqtrade/freqtrade)
- freqtrade/data/btanalysis/trade_parallelism.py:121:46 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["order_filled_timestamp"]` on object of type `str`
+ freqtrade/data/btanalysis/trade_parallelism.py:121:46 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["order_filled_timestamp"]` on object of type `str`
- freqtrade/templates/FreqaiExampleStrategy.py:290:24 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["close"]` on object of type `str`
+ freqtrade/templates/FreqaiExampleStrategy.py:290:24 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["close"]` on object of type `str`

mkdocs (https://github.com/mkdocs/mkdocs)
- mkdocs/tests/structure/nav_tests.py:97:18 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["About"]` on object of type `str`
+ mkdocs/tests/structure/nav_tests.py:97:18 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["About"]` on object of type `str`

mypy (https://github.com/python/mypy)
- mypy/typeshed/stdlib/codecs.pyi:302:9 error[invalid-method-override] Invalid override of method `writelines`: Definition is incompatible with `IO.writelines`
- mypy/typeshed/stdlib/weakref.pyi:113:9 error[invalid-method-override] Invalid override of method `setdefault`: Definition is incompatible with `MutableMapping.setdefault`
- mypy/typeshed/stdlib/weakref.pyi:125:9 error[invalid-method-override] Invalid override of method `update`: Definition is incompatible with `MutableMapping.update`
- mypy/typeshed/stdlib/xml/dom/minidom.pyi:184:9 error[invalid-method-override] Invalid override of method `replaceChild`: Definition is incompatible with `Node.replaceChild`
- mypy/typeshed/stdlib/xml/dom/minidom.pyi:347:9 error[invalid-method-override] Invalid override of method `replaceChild`: Definition is incompatible with `Node.replaceChild`
- mypy/typeshed/stdlib/xml/dom/minidom.pyi:562:9 error[invalid-method-override] Invalid override of method `replaceChild`: Definition is incompatible with `Node.replaceChild`

operator (https://github.com/canonical/operator)
- ops/pebble.py:567:19 error[invalid-argument-type] Method `__getitem__` of type `(Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]) | (Overload[(key: SupportsIndex, /) -> int, (key: slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> bytes])` cannot be called with key of type `slice[Any, Any, Any]` on object of type `AnyStr@ExecError`
+ ops/pebble.py:567:19 error[invalid-argument-type] Method `__getitem__` of type `(bound method AnyStr@ExecError.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str) | (Overload[(key: SupportsIndex, /) -> int, (key: slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> bytes])` cannot be called with key of type `slice[Any, Any, Any]` on object of type `AnyStr@ExecError`

pandas (https://github.com/pandas-dev/pandas)
- pandas/core/dtypes/missing.py:652:16 error[invalid-argument-type] Method `__getitem__` of type `(bound method _ArrLikeT@remove_na_arraylike.__getitem__(key) -> Unknown) | (Overload[(key: SupportsIndex) -> Any, (key: slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[Any]] | list[int] | list[builtins.bool] | Series) -> Index]) | (Overload[(key: ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]] | tuple[ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]], ...], /) -> ndarray[tuple[Any, ...], dtype[Any]], (key: SupportsIndex | tuple[SupportsIndex, ...], /) -> Any, (key: SupportsIndex | slice[Any, Any, Any] | EllipsisType | ... omitted 5 union elements, /) -> ndarray[tuple[Any, ...], dtype[Any]], (key: str, /) -> ndarray[tuple[Any, ...], dtype[Any]], (key: list[str], /) -> ndarray[tuple[Any, ...], Unknown]])` cannot be called with key of type `ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]` on object of type `_ArrLikeT@remove_na_arraylike`
+ pandas/core/dtypes/missing.py:652:16 error[invalid-argument-type] Method `__getitem__` of type `(bound method _ArrLikeT@remove_na_arraylike.__getitem__(key) -> Unknown) | (Overload[(key: SupportsIndex) -> Any, (key: slice[Any, Any, Any] | ndarray[tuple[Any, ...], dtype[Any]] | list[int] | list[builtins.bool] | Series) -> Index]) | (Overload[(key: ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]] | tuple[ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]], ...], /) -> ndarray[tuple[Any, ...], dtype[Any]], (key: SupportsIndex | tuple[SupportsIndex, ...], /) -> Any, (key: SupportsIndex | slice[Any, Any, Any] | EllipsisType | ... omitted 5 union elements, /) -> ndarray[tuple[Any, ...], dtype[Any]]])` cannot be called with key of type `ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]]` on object of type `_ArrLikeT@remove_na_arraylike`
+ pandas/io/json/_json.py:1105:9 error[invalid-method-override] Invalid override of method `__next__`: Definition is incompatible with `Iterator.__next__`

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/core/groupby/generic.pyi:489:9 error[invalid-method-override] Invalid override of method `size`: Definition is incompatible with `GroupBy.size`
+ pandas-stubs/core/indexes/timedeltas.pyi:135:76 warning[unused-ignore-comment] Unused `ty: ignore` directive
- tests/indexes/bool/test_truediv.py:31:11 error[type-assertion-failure] Type `Index[int | float | complex]` does not match asserted type `Index[int | float]`
- tests/indexes/bool/test_truediv.py:38:11 error[type-assertion-failure] Type `Index[int | float | complex]` does not match asserted type `Index[int | float]`
+ tests/indexes/bool/test_truediv.py:33:11 error[type-assertion-failure] Type `Index[int | float]` does not match asserted type `Index[int | float | complex]`
+ tests/indexes/bool/test_truediv.py:40:11 error[type-assertion-failure] Type `Index[int | float]` does not match asserted type `Index[int | float | complex]`
- tests/indexes/complex/test_add.py:55:11 error[type-assertion-failure] Type `Index[Unknown]` does not match asserted type `Index[int | float | complex]`
+ tests/indexes/complex/test_add.py:55:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Index[int | float | complex]`
- tests/indexes/complex/test_mul.py:49:23 error[unsupported-operator] Operator `*` is not supported between objects of type `Literal[1]` and `Index[int | float | complex]`
- tests/indexes/float/test_add.py:27:11 error[type-assertion-failure] Type `Index[int | float | complex]` does not match asserted type `Index[int | float]`
- tests/indexes/float/test_truediv.py:35:11 error[type-assertion-failure] Type `Index[int | float | complex]` does not match asserted type `Index[int | float]`
- tests/indexes/int/test_add.py:24:11 error[type-assertion-failure] Type `Index[int | float | complex]` does not match asserted type `Index[int | float]`
- tests/indexes/int/test_floordiv.py:35:11 error[type-assertion-failure] Type `Index[int | float]` does not match asserted type `Index[int]`
- tests/indexes/int/test_floordiv.py:44:11 error[type-assertion-failure] Type `Index[int | float]` does not match asserted type `Index[int]`
- tests/indexes/int/test_truediv.py:36:11 error[type-assertion-failure] Type `Index[int | float | complex]` does not match asserted type `Index[int | float]`
+ tests/indexes/str/test_add.py:31:14 error[unsupported-operator] Operator `+` is not supported between objects of type `Index[str]` and `Literal[4]`
- tests/indexes/str/test_mul.py:69:15 error[unsupported-operator] Operator `*` is not supported between objects of type `Index[str]` and `list[int | float]`
- tests/indexes/str/test_mul.py:76:23 error[unsupported-operator] Operator `*` is not supported between objects of type `list[int]` and `Index[str]`
- tests/indexes/str/test_mul.py:80:15 error[unsupported-operator] Operator `*` is not supported between objects of type `list[datetime]` and `Index[str]`
- tests/indexes/str/test_mul.py:81:15 error[unsupported-operator] Operator `*` is not supported between objects of type `list[timedelta]` and `Index[str]`
- tests/series/bool/test_add.py:31:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[bool]`
- tests/series/bool/test_add.py:37:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int]`
- tests/series/bool/test_add.py:101:11 error[type-assertion-failure] Type `Series[Unknown]` does not match asserted type `Series[int]`
+ tests/series/bool/test_add.py:101:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int]`
- tests/series/bool/test_truediv.py:32:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
- tests/series/bool/test_truediv.py:39:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
- tests/series/bool/test_truediv.py:75:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
+ tests/series/bool/test_truediv.py:59:11 error[type-assertion-failure] Type `Series[int | float]` does not match asserted type `Series[int | float | complex]`
- tests/series/complex/test_add.py:91:11 error[type-assertion-failure] Type `Series[Unknown]` does not match asserted type `Series[int | float | complex]`
+ tests/series/complex/test_add.py:91:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/complex/test_add.py:92:11 error[type-assertion-failure] Type `Series[Unknown]` does not match asserted type `Series[int | float | complex]`
+ tests/series/complex/test_add.py:92:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/complex/test_add.py:93:11 error[type-assertion-failure] Type `Series[Unknown]` does not match asserted type `Series[int | float | complex]`
+ tests/series/complex/test_add.py:93:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/complex/test_add.py:109:11 error[type-assertion-failure] Type `Series[Unknown]` does not match asserted type `Series[int | float | complex]`
+ tests/series/complex/test_add.py:109:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/complex/test_add.py:112:11 error[type-assertion-failure] Type `Series[Unknown]` does not match asserted type `Series[int | float | complex]`
+ tests/series/complex/test_add.py:112:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/complex/test_add.py:124:9 error[type-assertion-failure] Type `Series[Unknown]` does not match asserted type `Series[int | float | complex]`
+ tests/series/complex/test_add.py:124:9 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/complex/test_mul.py:58:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/complex/test_mul.py:165:11 error[type-assertion-failure] Type `Series[Unknown]` does not match asserted type `Series[int | float | complex]`
+ tests/series/complex/test_mul.py:165:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/complex/test_mul.py:180:9 error[type-assertion-failure] Type `Series[Unknown]` does not match asserted type `Series[int | float | complex]`
+ tests/series/complex/test_mul.py:180:9 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/float/test_add.py:50:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
+ tests/series/float/test_add.py:56:23 error[unsupported-operator] Operator `+` is not supported between objects of type `list[int | float | complex]` and `Series[int | float]`
+ tests/series/float/test_add.py:67:9 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/float/test_add.py:102:11 error[type-assertion-failure] Type `Series[Unknown]` does not match asserted type `Series[int | float]`
+ tests/series/float/test_add.py:102:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float]`
- tests/series/float/test_mul.py:40:23 error[unsupported-operator] Operator `*` is not supported between objects of type `Series[int | float]` and `Literal[True]`
- tests/series/float/test_mul.py:57:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float]`
- tests/series/float/test_truediv.py:44:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
+ tests/series/float/test_truediv.py:46:11 error[type-assertion-failure] Type `Series[int | float]` does not match asserted type `Series[int | float | complex]`
- tests/series/int/test_add.py:95:11 error[type-assertion-failure] Type `Series[Unknown]` does not match asserted type `Series[int]`
+ tests/series/int/test_add.py:95:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int]`
- tests/series/int/test_floordiv.py:60:11 error[type-assertion-failure] Type `Series[int | float]` does not match asserted type `Series[int]`
- tests/series/int/test_floordiv.py:61:11 error[type-assertion-failure] Type `Series[int | float]` does not match asserted type `Series[int]`
- tests/series/int/test_truediv.py:45:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
- tests/series/int/test_truediv.py:88:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
+ tests/series/int/test_truediv.py:91:9 error[type-assertion-failure] Type `Series[int | float]` does not match asserted type `Series[int | float | complex]`
- tests/series/str/test_add.py:40:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[str]`
+ tests/series/str/test_add.py:35:14 error[unsupported-operator] Operator `+` is not supported between objects of type `Literal[4]` and `Series[str]`
+ tests/series/str/test_add.py:54:14 error[unsupported-operator] Operator `+` is not supported between objects of type `Series[str]` and `list[int]`
- tests/series/str/test_add.py:102:9 error[type-assertion-failure] Type `Series[Unknown]` does not match asserted type `Never`
+ tests/series/str/test_add.py:102:9 error[type-assertion-failure] Type `Unknown` does not match asserted type `Never`
- tests/series/str/test_mul.py:51:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[str]`
- tests/series/str/test_mul.py:53:15 error[unsupported-operator] Operator `*` is not supported between objects of type `float` and `Series[str]`
- tests/series/str/test_mul.py:65:9 error[no-matching-overload] No overload of bound method `Series.mul` matches arguments
- tests/series/str/test_mul.py:71:9 error[no-matching-overload] No overload of bound method `Series.rmul` matches arguments
- tests/series/str/test_mul.py:103:23 error[no-matching-overload] No overload of bound method `Series.mul` matches arguments
- tests/series/str/test_mul.py:111:9 error[no-matching-overload] No overload of bound method `Series.rmul` matches arguments
- tests/series/str/test_mul.py:117:9 error[no-matching-overload] No overload of bound method `Series.rmul` matches arguments
- tests/series/str/test_mul.py:193:15 error[unsupported-operator] Operator `*` is not supported between objects of type `DatetimeIndex` and `Series[str]`
+ tests/series/timedelta/test_floordiv.py:46:15 error[unsupported-operator] Operator `//` is not supported between objects of type `Literal[True]` and `Series[Timedelta]`
+ tests/series/timedelta/test_floordiv.py:47:15 error[unsupported-operator] Operator `//` is not supported between objects of type `Literal[1]` and `Series[Timedelta]`
+ tests/series/timedelta/test_floordiv.py:71:9 error[no-matching-overload] No overload of bound method `Series.rfloordiv` matches arguments
+ tests/series/timedelta/test_floordiv.py:73:9 error[no-matching-overload] No overload of bound method `Series.rfloordiv` matches arguments
- tests/series/timedelta/test_mul.py:50:23 error[no-matching-overload] No overload of bound method `Series.mul` matches arguments
- tests/series/timedelta/test_mul.py:56:23 error[no-matching-overload] No overload of bound method `Series.rmul` matches arguments
- tests/series/timedelta/test_mul.py:57:23 error[no-matching-overload] No overload of bound method `Series.rmul` matches arguments
- tests/series/timedelta/test_mul.py:69:23 error[unsupported-operator] Operator `*` is not supported between objects of type `Series[Timedelta]` and `list[int | float]`
- tests/series/timedelta/test_mul.py:71:15 error[unsupported-operator] Operator `*` is not supported between objects of type `Series[Timedelta]` and `list[int | float | complex]`
- tests/series/timedelta/test_mul.py:76:23 error[unsupported-operator] Operator `*` is not supported between objects of type `list[int | float]` and `Series[Timedelta]`
- tests/series/timedelta/test_mul.py:83:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[Timedelta]`
- tests/series/timedelta/test_mul.py:88:9 error[no-matching-overload] No overload of bound method `Series.rmul` matches arguments
- tests/series/timedelta/test_mul.py:90:23 error[no-matching-overload] No overload of bound method `Series.rmul` matches arguments
- tests/series/timedelta/test_truediv.py:38:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[Timedelta]`
- tests/series/timedelta/test_truediv.py:50:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float]`
- tests/series/timedelta/test_truediv.py:80:23 error[no-matching-overload] No overload of bound method `Series.rtruediv` matches arguments
- tests/series/timedelta/test_truediv.py:88:23 error[no-matching-overload] No overload of bound method `Series.rtruediv` matches arguments
- tests/series/timedelta/test_truediv.py:246:23 error[no-matching-overload] No overload of bound method `Series.rtruediv` matches arguments
+ tests/series/timedelta/test_truediv.py:46:15 error[unsupported-operator] Operator `/` is not supported between objects of type `Literal[1]` and `Series[Timedelta]`
+ tests/series/timedelta/test_truediv.py:47:15 error[unsupported-operator] Operator `/` is not supported between objects of type `float` and `Series[Timedelta]`
+ tests/series/timedelta/test_truediv.py:78:9 error[no-matching-overload] No overload of bound method `Series.rtruediv` matches arguments
+ tests/series/timedelta/test_truediv.py:85:9 error[no-matching-overload] No overload of bound method `Series.rtruediv` matches arguments

pandera (https://github.com/pandera-dev/pandera)
- pandera/typing/pandas.py:406:45 error[invalid-argument-type] Argument to bound method `DataFrame.from_records` is incorrect: Expected `Iterable[SequenceNotStr[Any]] | Iterable[Mapping[Unknown, Any]] | Mapping[Unknown, Any] | Mapping[Unknown, SequenceNotStr[Any]]`, found `ndarray[tuple[Any, ...], dtype[Any]] | list[tuple[Any, ...]] | dict[Any, Any] | DataFrame | Sequence[Mapping[str, Any]]`
+ pandera/typing/pandas.py:406:45 error[invalid-argument-type] Argument to bound method `DataFrame.from_records` is incorrect: Expected `ndarray[tuple[int, int], dtype[Any]] | Iterable[SequenceNotStr[Any]] | Iterable[Mapping[Unknown, Any]] | Mapping[Unknown, Any] | Mapping[Unknown, SequenceNotStr[Any]]`, found `ndarray[tuple[Any, ...], dtype[Any]] | list[tuple[Any, ...]] | dict[Any, Any] | DataFrame | Sequence[Mapping[str, Any]]`

rich (https://github.com/Textualize/rich)
- rich/_null_file.py:59:9 error[invalid-method-override] Invalid override of method `write`: Definition is incompatible with `IO.write`

schema_salad (https://github.com/common-workflow-language/schema_salad)
- src/schema_salad/jsonld_context.py:211:30 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `str` on object of type `str`
+ src/schema_salad/jsonld_context.py:211:30 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `str` on object of type `str`
- src/schema_salad/ref_resolver.py:496:32 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["$graph"]` on object of type `str`
+ src/schema_salad/ref_resolver.py:496:32 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["$graph"]` on object of type `str`
- src/schema_salad/ref_resolver.py:1159:45 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `str` on object of type `str`
+ src/schema_salad/ref_resolver.py:1159:45 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `str` on object of type `str`
- src/schema_salad/ref_resolver.py:1161:41 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `str` on object of type `str`
+ src/schema_salad/ref_resolver.py:1161:41 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `str` on object of type `str`
- src/schema_salad/schema.py:564:21 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["names"]` on object of type `str`
+ src/schema_salad/schema.py:564:21 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["names"]` on object of type `str`
- src/schema_salad/schema.py:564:21 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> LiteralString, (key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str]` cannot be called with key of type `Literal["type"]` on object of type `str`
+ src/schema_salad/schema.py:564:21 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["type"]` on object of type `str`

scipy (https://github.com/scipy/scipy)
- scipy/optimize/_differentialevolution.py:1441:9 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]] | tuple[ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]], ...], /) -> ndarray[tuple[Any, ...], dtype[float64]], (key: SupportsIndex | tuple[SupportsIndex, ...], /) -> Any, (key: SupportsIndex | slice[Any, Any, Any] | EllipsisType | ... omitted 5 union elements, /) -> ndarray[tuple[Any, ...], dtype[float64]], (key: str, /) -> ndarray[tuple[Any, ...], dtype[Any]], (key: list[str], /) -> ndarray[tuple[Any, ...], Unknown]]` cannot be called with key of type `tuple[list[Unknown | signedinteger[_64Bit] | int], slice[None, None, None]]` on object of type `ndarray[tuple[Any, ...], dtype[float64]]`
+ scipy/optimize/_differentialevolution.py:1441:9 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]] | tuple[ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]], ...], /) -> ndarray[tuple[Any, ...], dtype[float64]], (key: SupportsIndex | tuple[SupportsIndex, ...], /) -> Any, (key: SupportsIndex | slice[Any, Any, Any] | EllipsisType | ... omitted 5 union elements, /) -> ndarray[tuple[Any, ...], dtype[float64]]]` cannot be called with key of type `tuple[list[Unknown | signedinteger[_64Bit] | int], slice[None, None, None]]` on object of type `ndarray[tuple[Any, ...], dtype[float64]]`

scipy-stubs (https://github.com/scipy/scipy-stubs)
+ scipy-stubs/sparse/_dok.pyi:536:9 error[invalid-method-override] Invalid override of method `__getitem__`: Definition is incompatible with `IndexMixin.__getitem__`
+ scipy-stubs/stats/_distribution_infrastructure.pyi:321:9 error[invalid-method-override] Invalid override of method `support`: Definition is incompatible with `_ProbabilityDistribution.support`
+ scipy-stubs/stats/_distribution_infrastructure.pyi:328:9 error[invalid-method-override] Invalid override of method `median`: Definition is incompatible with `_ProbabilityDistribution.median`
+ scipy-stubs/stats/_distribution_infrastructure.pyi:588:9 error[invalid-method-override] Invalid override of method `logpdf`: Definition is incompatible with `_ProbabilityDistribution.logpdf`
+ scipy-stubs/stats/_distribution_infrastructure.pyi:816:9 error[invalid-method-override] Invalid override of method `cdf`: Definition is incompatible with `_ProbabilityDistribution.cdf`
+ scipy-stubs/stats/_distribution_infrastructure.pyi:1431:9 error[invalid-method-override] Invalid override of method `ilogccdf`: Definition is incompatible with `_ProbabilityDistribution.ilogccdf`
- tests/spatial/test__rigid_transform.pyi:62:1 error[type-assertion-failure] Type `RigidTransform[tuple[()]] | RigidTransform[tuple[int]]` does not match asserted type `RigidTransform[tuple[int]]`
+ tests/spatial/test__rigid_transform.pyi:62:1 error[type-assertion-failure] Type `RigidTransform[tuple[int]] | RigidTransform[tuple[Any, ...]]` does not match asserted type `RigidTransform[tuple[int]]`

spack (https://github.com/spack/spack)
- lib/spack/spack/vendor/markupsafe/__init__.py:198:9 error[invalid-method-override] Invalid override of method `rpartition`: Definition is incompatible with `str.rpartition`

sympy (https://github.com/sympy/sympy)
- sympy/core/tests/test_multidimensional.py:7:20 error[invalid-argument-type] Argument to constructor `map.__new__` is incorrect: Expected `(LiteralString, /) -> Unknown`, found `<class 'Function'>`
+ sympy/core/tests/test_multidimensional.py:7:20 error[invalid-argument-type] Argument to constructor `map.__new__` is incorrect: Expected `(str, /) -> Unknown`, found `<class 'Function'>`
- sympy/physics/tests/test_secondquant.py:51:16 error[invalid-argument-type] Argument to constructor `map.__new__` is incorrect: Expected `(LiteralString, /) -> Unknown`, found `<class 'Function'>`
+ sympy/physics/tests/test_secondquant.py:51:16 error[invalid-argument-type] Argument to constructor `map.__new__` is incorrect: Expected `(str, /) -> Unknown`, found `<class 'Function'>`
- sympy/solvers/tests/test_pde.py:36:31 error[invalid-argument-type] Argument to constructor `map.__new__` is incorrect: Expected `(LiteralString, /) -> Unknown`, found `<class 'Function'>`
+ sympy/solvers/tests/test_pde.py:36:31 error[invalid-argument-type] Argument to constructor `map.__new__` is incorrect: Expected `(str, /) -> Unknown`, found `<class 'Function'>`
- sympy/solvers/tests/test_solvers.py:1586:19 error[invalid-argument-type] Argument to constructor `map.__new__` is incorrect: Expected `(LiteralString, /) -> Unknown`, found `<class 'Function'>`
+ sympy/solvers/tests/test_solvers.py:1586:19 error[invalid-argument-type] Argument to constructor `map.__new__` is incorrect: Expected `(str, /) -> Unknown`, found `<class 'Function'>`
- sympy/utilities/_compilation/runners.py:130:43 error[invalid-argument-type] Argument to constructor `map.__new__` is incorrect: Expected `Iterable[str | Buffer]`, found `Unknown | None`

urllib3 (https://github.com/urllib3/urllib3)
- src/urllib3/_collections.py:275:9 error[invalid-method-override] Invalid override of method `setdefault`: Definition is incompatible with `MutableMapping.setdefault`

xarray (https://github.com/pydata/xarray)
- xarray/core/indexing.py:406:19 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]] | tuple[ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]], ...], /) -> ndarray[tuple[Any, ...], dtype[object]], (key: SupportsIndex | tuple[SupportsIndex, ...], /) -> Any, (key: SupportsIndex | slice[Any, Any, Any] | EllipsisType | ... omitted 5 union elements, /) -> ndarray[tuple[Any, ...], dtype[object]], (key: str, /) -> ndarray[tuple[object, ...], dtype[Any]], (key: list[str], /) -> ndarray[tuple[object, ...], Unknown]]` cannot be called with key of type `int` on object of type `ndarray[tuple[object, ...], dtype[object]]`
+ xarray/core/indexing.py:406:19 error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]] | tuple[ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]], ...], /) -> ndarray[tuple[Any, ...], dtype[object]], (key: SupportsIndex | tuple[SupportsIndex, ...], /) -> Any, (key: SupportsIndex | slice[Any, Any, Any] | EllipsisType | ... omitted 5 union elements, /) -> ndarray[tuple[Any, ...], dtype[object]]]` cannot be called with key of type `int` on object of type `ndarray[tuple[object, ...], dtype[object]]`

Full report with detailed diff (timing results)

@codspeed-hq

codspeed-hq Bot commented Apr 18, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 6.81%

❌ 2 regressed benchmarks
✅ 63 untouched benchmarks
⏩ 60 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime pydantic 34.5 s 37.1 s -6.94%
WallTime colour_science 52.3 s 56 s -6.69%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing charlie/bind-selfs (348213d) with main (5a6c811)

Open in CodSpeed

Footnotes

  1. 60 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@charliermarsh charliermarsh added the bug Something isn't working label Apr 19, 2026
@astral-sh-bot

astral-sh-bot Bot commented Apr 19, 2026

Copy link
Copy Markdown

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@charliermarsh charliermarsh force-pushed the charlie/bind-selfs branch 5 times, most recently from 1d57f74 to fd58449 Compare April 20, 2026 20:31
@charliermarsh charliermarsh marked this pull request as ready for review April 20, 2026 20:43
@charliermarsh charliermarsh marked this pull request as draft April 21, 2026 17:49
@charliermarsh charliermarsh force-pushed the charlie/bind-selfs branch 5 times, most recently from 26c456e to ba61691 Compare April 22, 2026 02:25
@charliermarsh charliermarsh marked this pull request as ready for review April 22, 2026 02:25
@charliermarsh charliermarsh force-pushed the charlie/bind-selfs branch 2 times, most recently from 7f009ab to d6274ae Compare April 26, 2026 00:13
@MichaReiser

This comment was marked as resolved.

@charliermarsh

This comment was marked as resolved.

@MichaReiser

This comment was marked as resolved.

@charliermarsh

This comment was marked as resolved.

@carljm carljm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I think it makes sense to land this step and iterate -- most of my comments have to do with making sure we preserve relevant context for future work, even if we don't do that work right away.

reveal_type(foo3.takes_self_or_int(foo3)) # revealed: Foo3
reveal_type(foo3.takes_self_or_int(1)) # revealed: int

class Base:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are also simpler non-generic cases where we are now technically overly permissive. For example:

from typing import Any, Generic, TypeVar, overload

class Base:
  @overload
  def method(self) -> None: ...
  @overload
  def method(self: Child1, extra: str) -> None: ...
  def method(self, extra: str = "") -> None: ...

class Child1(Base):
  def method(self) -> None: ...
  
class Child2(Base):
  def method(self) -> None: ...

Child1.method should definitely error here, but doesn't in this PR. Child2.method is more subtle -- I think it would be reasonable to let that pass, although the strictest version of this check would still error on it, since class Diamond(Child1, Child2): ... is technically possible.

Anyway, I support deferring all that from this PR -- the current false positives before this PR are much worse than the false negatives after this PR. Mypy already seems to be quite forgiving here, and I suspect few people will object to that. Not even sure it's an immediate priority to follow up and close those holes -- but we should capture the gaps either in tests in this PR with TODOs, and/or in a new issue (since astral-sh/ty#2693 will be closed by this PR.)

I do think this PR should at least include a test locking in the Liskov cases that are correctly fixed in this PR. This case from astral-sh/ty#2612 would be a good candidate: it legitimately should not error, and this PR fixes it so it does not error:

from __future__ import annotations

from collections.abc import Iterator

class MyStr(str):
    def __iter__(self) -> Iterator[str]:
        raise NotImplementedError

(Though it might be good to also have a version of that test that's less typeshed-reliant and clarifies the behavior, e.g. with our own base class in place of str and a final subclass in place of LiteralString. Then we get into permutations of that that arguably should error, like the Child1 and maybe Child2 case above, and the generic cases, and we're back to adding a full test suite for Liskov behavior with self-annotating overrides, with some TODOs... which I think would be great to land in this PR, or immediately following this PR.)

return 1

def put(self, x: str) -> None: ...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a reveal_type(ProtocolSelfImplementation().method) in here, noting specifically that we should eliminate the first overload but don't, would have helped me understand this test more easily.

Comment on lines +1029 to +1030
reveal_type(Base.from_value) # revealed: bound method <class 'Base'>.from_value(x: int) -> int
reveal_type(Child.from_value) # revealed: Overload[(x: int) -> int, (x: str) -> str]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is orthogonal to this PR, but the discrepancy between these displays is kind of weird -- none of the "bound method <class ...>' stuff when it is overloaded.

self.pending.intersect(self.db, self.constraints, when);
}
return Ok(());
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm quite suspicious of the narrowness of this special case, and in general we want to stop adding behavior here in the old constraint solver and instead be porting things over to the new solver. But I think we could keep this with a TODO comment if it fixes important behavior.

It seems like maybe a better fix here would require preserving a constraint set from overload receiver matching, rather than just deciding to keep or discard overloads. That is, can_bind_self_to would become when_can_bind_self_to and return a constraint set instead of a bool, and each remaining overload would retain its receviver constraints. (I think that direction would also maybe solve some other TODOs in this PR?) If that seems right, it would be good to preserve that general idea, either in a comment in this PR, or in an issue.

@charliermarsh

Copy link
Copy Markdown
Member Author

Great review, thank you! I will own the immediate follow-ups (in new PRs) where I feel capable, and file issues where I don't.

@MichaReiser

Copy link
Copy Markdown
Member

I'm very excited for the LSP cases that this PR fixes. Thanks Charlie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ty Multi-file analysis & type inference

Projects

None yet

5 participants