[ty] Narrow bound method overloads by receiver#24707
Conversation
Typing conformance resultsNo changes detected ✅Current numbersThe 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. |
Memory usage reportSummary
Significant changesClick to expand detailed breakdownsphinx
prefect
trio
flake8
|
|
| 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]]`
Merging this PR will degrade performance by 6.81%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
89fa69a to
9b9bf8e
Compare
|
1d57f74 to
fd58449
Compare
fd58449 to
d230623
Compare
26c456e to
ba61691
Compare
7f009ab to
d6274ae
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
carljm
left a comment
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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: ... | ||
|
|
There was a problem hiding this comment.
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.
| 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] |
There was a problem hiding this comment.
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(()); | ||
| } |
There was a problem hiding this comment.
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.
|
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. |
|
I'm very excited for the LSP cases that this PR fixes. Thanks Charlie |
Summary
Given:
On main, we treat
Base().convertas if both overloads are still possible, including the overload that requiresself: "Child".After this PR:
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.