Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ty] Restrict length narrowing to types that encode their length#25840

Merged
carljm merged 2 commits into
mainfrom
cjm/3710-restrict-lengthbased-narrowing
Jun 10, 2026
Merged

[ty] Restrict length narrowing to types that encode their length#25840
carljm merged 2 commits into
mainfrom
cjm/3710-restrict-lengthbased-narrowing

Conversation

@carljm

@carljm carljm commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Restrict exact len() narrowing to types that actually encode their possible lengths, so that we don't wrongly preserve length-narrowings on types with mutable length.

Closes astral-sh/ty#3710.

Test plan

Added/updated mdtests.

Ecosystem analysis

72 of the added diagnostics (48 in apprise, 19 in scrapy, plus some others) are from restoring correct reachability to code that was previously erroneously marked unreachable.

33 new diagnostics involve cases where we previously narrowed None out of a type after a len call (which itself errors since None is not Sized), since None is disjoint from ExactlySized. We could easily continue to do this (remove any non Sized types when narrowing from a len check), and I don't think it's wrong to do so? But it's kind of odd to narrow from a failed call, and no other type checker does it, so I haven't done it in this PR.

12 new diagnostics (all in packaging, or pip from its vendored packaging) come from a case where we are length-narrowing correctly, it's just we top-materialize isinstance and object is not assignable where a value from that tuple is used. This was silenced on main because we don't support exact unpacking from an intersection at all, and we previously had an intersection with ExactlySized here.

Four new diagnostics in ppb-vector come from code like this:

def unpack(value: Sequence[int] | Mapping[str, int]):
    if isinstance(value, Sequence) and len(value) == 2:
        return value[0]
    if isinstance(value, Mapping) and "x" in value and len(value) == 2:
        return value["x"]
    raise ValueError

Where retaining the intersection with ~ExactlySized[2] allowed us to rule out the "both a Sequence and a Mapping" case in the second branch (since if it were a sequence of length 2 it would have already taken the first branch). This is the only case where this PR regresses results. We could keep this by restoring ExactlySized and continuing to use it with Sequence and Mapping types -- but that would add a lot of code for something that has a very small ecosystem impact.

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

astral-sh-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

Typing conformance results

The percentage of diagnostics emitted that were expected errors held steady at 94.36%. The percentage of expected errors that received a diagnostic held steady at 88.82%. The number of fully passing files held steady at 93/134.

Summary

How are test cases classified?

Each test case represents one expected error annotation or a group of annotations sharing a tag. Counts are per test case, not per diagnostic — multiple diagnostics on the same line count as one. Required annotations (E) are true positives when ty flags the expected location and false negatives when it does not. Optional annotations (E?) are true positives when flagged but true negatives (not false negatives) when not. Tagged annotations (E[tag]) require ty to flag exactly one of the tagged lines; tagged multi-annotations (E[tag+]) allow any number up to the tag count. Flagging unexpected locations counts as a false positive.

Metric Old New Diff Outcome
True Positives 953 953 +0
False Positives 57 57 +0
False Negatives 120 120 +0
Total Diagnostics 1058 1058 +0
Precision 94.36% 94.36% +0.00%
Recall 88.82% 88.82% +0.00%
Passing Files 93/134 93/134 +0

True positives changed (3)

3 diagnostics
Test case Diff

tuples_type_compat.py:75:76

-error[type-assertion-failure] Type `tuple[int] | (tuple[int, *tuple[str, ...], int] & ExactlySized[Literal[1, True]])` does not match asserted type `tuple[int]`
+error[type-assertion-failure] Type `tuple[int]` does not match asserted type `tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]`

tuples_type_compat.py:80:81

-error[type-assertion-failure] Type `tuple[str, str] | (tuple[int, *tuple[str, ...], int] & ExactlySized[Literal[2]])` does not match asserted type `tuple[str, str] | tuple[int, int]`
+error[type-assertion-failure] Type `tuple[str, str] | tuple[int, int]` does not match asserted type `tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]`

tuples_type_compat.py:85:86

-error[type-assertion-failure] Type `tuple[int, *tuple[str, ...], int] & ExactlySized[Literal[3]]` does not match asserted type `tuple[int, str, int]`
+error[type-assertion-failure] Type `tuple[int, str, int]` does not match asserted type `tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]`

@astral-sh-bot

astral-sh-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

Memory usage report

Summary

Project Old New Diff Outcome
flake8 35.27MB 35.07MB -0.55% (199.28kB) ⬇️
trio 87.18MB 86.91MB -0.31% (274.65kB) ⬇️
sphinx 206.05MB 205.53MB -0.25% (529.67kB) ⬇️
prefect 558.79MB 557.19MB -0.29% (1.59MB) ⬇️

Significant changes

Click to expand detailed breakdown

flake8

Name Old New Diff Outcome
parsed_module 11.90MB 11.83MB -0.64% (77.98kB) ⬇️
semantic_index 9.72MB 9.65MB -0.66% (65.79kB) ⬇️
source_text 1.59MB 1.57MB -0.84% (13.62kB) ⬇️
Definition 1.82MB 1.81MB -0.58% (10.78kB) ⬇️
all_narrowing_constraints_for_expression 166.99kB 162.79kB -2.51% (4.20kB) ⬇️
File 211.48kB 207.69kB -1.80% (3.80kB) ⬇️
ScopeId 235.98kB 233.75kB -0.94% (2.23kB) ⬇️
IntersectionType 51.73kB 50.27kB -2.84% (1.47kB) ⬇️
infer_definition_types 1.53MB 1.52MB -0.08% (1.27kB) ⬇️
is_redundant_with_impl 76.27kB 75.15kB -1.46% (1.11kB) ⬇️
infer_expression_types_impl 969.27kB 968.20kB -0.11% (1.07kB) ⬇️
Type<'db>::class_member_with_policy_ 317.16kB 316.21kB -0.30% (980.00B) ⬇️
is_redundant_with_impl::interned_arguments 90.06kB 89.12kB -1.05% (968.00B) ⬇️
CallableType 205.06kB 204.12kB -0.46% (960.00B) ⬇️
StaticClassLiteral<'db>::try_mro_ 291.81kB 290.96kB -0.29% (872.00B) ⬇️
... 46 more

trio

Name Old New Diff Outcome
parsed_module 18.28MB 18.20MB -0.42% (77.98kB) ⬇️
semantic_index 21.16MB 21.09MB -0.30% (65.79kB) ⬇️
all_narrowing_constraints_for_expression 1007.28kB 988.59kB -1.86% (18.70kB) ⬇️
source_text 3.74MB 3.73MB -0.36% (13.62kB) ⬇️
Definition 3.61MB 3.60MB -0.29% (10.78kB) ⬇️
member_lookup_with_policy_inner 1.39MB 1.38MB -0.63% (8.93kB) ⬇️
Type<'db>::class_member_with_policy_ 1.15MB 1.14MB -0.70% (8.19kB) ⬇️
is_redundant_with_impl 181.73kB 173.91kB -4.31% (7.83kB) ⬇️
IntersectionType 144.58kB 136.84kB -5.35% (7.73kB) ⬇️
member_lookup_with_policy_inner::interned_arguments 767.81kB 761.60kB -0.81% (6.21kB) ⬇️
is_redundant_with_impl::interned_arguments 224.38kB 219.57kB -2.14% (4.81kB) ⬇️
Type<'db>::class_member_with_policy_::interned_arguments 616.89kB 612.42kB -0.72% (4.47kB) ⬇️
File 771.16kB 767.36kB -0.49% (3.80kB) ⬇️
CallableType 671.14kB 667.49kB -0.54% (3.66kB) ⬇️
infer_expression_types_impl 6.50MB 6.50MB +0.04% (2.70kB) ⬇️
... 63 more

sphinx

Name Old New Diff Outcome
all_narrowing_constraints_for_expression 4.11MB 3.99MB -3.04% (127.85kB) ⬇️
parsed_module 22.31MB 22.24MB -0.34% (77.98kB) ⬇️
semantic_index 43.45MB 43.39MB -0.15% (65.79kB) ⬇️
infer_expression_types_impl 20.34MB 20.29MB -0.28% (58.56kB) ⬇️
infer_definition_types 20.15MB 20.12MB -0.13% (26.19kB) ⬇️
is_redundant_with_impl 918.29kB 896.14kB -2.41% (22.15kB) ⬇️
IntersectionType 561.70kB 542.78kB -3.37% (18.92kB) ⬇️
source_text 7.30MB 7.29MB -0.18% (13.62kB) ⬇️
is_redundant_with_impl::interned_arguments 1.14MB 1.13MB -1.14% (13.32kB) ⬇️
member_lookup_with_policy_inner 5.53MB 5.52MB -0.20% (11.19kB) ⬇️
Definition 7.41MB 7.40MB -0.14% (10.78kB) ⬇️
infer_scope_types_impl 12.47MB 12.46MB -0.08% (9.73kB) ⬇️
Type<'db>::class_member_with_policy_ 4.63MB 4.62MB -0.16% (7.80kB) ⬇️
member_lookup_with_policy_inner::interned_arguments 2.66MB 2.65MB -0.25% (6.91kB) ⬇️
Type<'db>::apply_specialization_inner_ 1.52MB 1.51MB -0.34% (5.34kB) ⬇️
... 69 more

prefect

Name Old New Diff Outcome
all_narrowing_constraints_for_expression 13.20MB 12.45MB -5.68% (767.34kB) ⬇️
infer_expression_types_impl 54.85MB 54.61MB -0.42% (238.07kB) ⬇️
infer_definition_types 73.76MB 73.65MB -0.14% (107.77kB) ⬇️
parsed_module 23.48MB 23.41MB -0.32% (77.98kB) ⬇️
semantic_index 129.49MB 129.42MB -0.05% (65.79kB) ⬇️
infer_scope_types_impl 47.30MB 47.26MB -0.09% (41.83kB) ⬇️
place_table 909.84kB 873.22kB -4.02% (36.62kB) ⬇️
IntersectionType 1012.27kB 980.11kB -3.18% (32.16kB) ⬇️
is_redundant_with_impl 1.99MB 1.96MB -1.43% (29.05kB) ⬇️
Type<'db>::class_member_with_policy_ 10.02MB 9.99MB -0.23% (23.34kB) ⬇️
member_lookup_with_policy_inner 13.27MB 13.25MB -0.17% (22.45kB) ⬇️
is_redundant_with_impl::interned_arguments 2.37MB 2.35MB -0.85% (20.54kB) ⬇️
member_lookup_with_policy_inner::interned_arguments 6.68MB 6.66MB -0.25% (16.88kB) ⬇️
Type<'db>::apply_specialization_inner_ 3.18MB 3.17MB -0.45% (14.54kB) ⬇️
source_text 25.28MB 25.26MB -0.05% (13.62kB) ⬇️
... 72 more

@astral-sh-bot

astral-sh-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

Lint rule Added Removed Changed
invalid-argument-type 29 1 30
unresolved-attribute 35 0 16
not-subscriptable 39 5 3
invalid-assignment 14 0 1
unsupported-operator 1 0 8
not-iterable 3 0 1
invalid-return-type 0 0 2
redundant-cast 2 0 0
unused-type-ignore-comment 0 2 0
invalid-method-override 1 0 0
Total 124 8 61
Raw diff (193 changes)
Expression (https://github.com/cognitedata/Expression)
- tests/test_array.py:102:44 error[invalid-argument-type] Argument to function `pipe` is incorrect: Expected `(TypedArray[int16] & ExactlySized[Literal[3]], /) -> (TypedArray[int16] & ExactlySized[Literal[3]]) | _A'return@curry_flip`, found `(_A'return@curry_flip, /) -> _A'return@curry_flip`
+ tests/test_array.py:102:44 error[invalid-argument-type] Argument to function `pipe` is incorrect: Expected `(TypedArray[int16], /) -> TypedArray[int16] | _A'return@curry_flip`, found `(_A'return@curry_flip, /) -> _A'return@curry_flip`

alerta (https://github.com/alerta/alerta)
+ alerta/utils/api.py:139:39 error[not-iterable] Object of type `None` is not iterable

apprise (https://github.com/caronc/apprise)
+ tests/test_api.py:198:18 error[invalid-argument-type] Argument to bound method `Apprise.add` is incorrect: Expected `str | dict[Unknown, Unknown] | NotifyBase | ... omitted 3 union elements`, found `list[str]`
+ tests/test_api.py:210:18 error[invalid-argument-type] Argument to bound method `Apprise.add` is incorrect: Expected `str | dict[Unknown, Unknown] | NotifyBase | ... omitted 3 union elements`, found `tuple[Literal["ntfys://user:pass@host/test"], Literal["json://localhost"]]`
+ tests/test_api.py:214:18 error[invalid-argument-type] Argument to bound method `Apprise.add` is incorrect: Expected `str | dict[Unknown, Unknown] | NotifyBase | ... omitted 3 union elements`, found `set[str]`
+ tests/test_api.py:237:18 error[invalid-argument-type] Argument to bound method `Apprise.add` is incorrect: Expected `AppriseAsset | None`, found `str`
+ tests/test_api.py:259:13 error[invalid-method-override] Invalid override of method `send`: Definition is incompatible with `NotifyBase.send`
+ tests/test_api.py:505:22 error[invalid-argument-type] Argument to `AppriseAsset.__init__` is incorrect: Expected `str | bytes | None`, found `Literal[42]`
+ tests/test_api.py:521:16 error[unresolved-attribute] Attribute `url_id` is not defined on `None` in union `NotifyBase | None`
+ tests/test_api.py:524:28 error[invalid-argument-type] Argument to function `Apprise.instantiate` is incorrect: Expected `str | dict[Unknown, Unknown]`, found `<class 'object'>`
+ tests/test_apprise_attachments.py:113:19 error[invalid-argument-type] Argument to bound method `AppriseAttachment.add` is incorrect: Expected `str | AttachBase | AppriseAttachment | list[str | AttachBase | AppriseAttachment]`, found `tuple[str, str, AttachBase | None]`
+ tests/test_apprise_attachments.py:158:28 error[invalid-argument-type] Argument to `AppriseAttachment.__init__` is incorrect: Expected `str | list[str | AttachBase | AppriseAttachment] | None`, found `tuple[str, str, AttachBase | None]`
+ tests/test_apprise_attachments.py:169:9 error[invalid-argument-type] Argument to bound method `AppriseAttachment.add` is incorrect: Expected `str | AttachBase | AppriseAttachment | list[str | AttachBase | AppriseAttachment]`, found `AttachBase | None`
+ tests/test_apprise_attachments.py:174:9 error[invalid-argument-type] Argument to bound method `AppriseAttachment.add` is incorrect: Expected `str | AttachBase | AppriseAttachment | list[str | AttachBase | AppriseAttachment]`, found `AttachBase | None`
+ tests/test_apprise_attachments.py:182:9 error[invalid-argument-type] Argument to bound method `AppriseAttachment.add` is incorrect: Expected `str | AttachBase | AppriseAttachment | list[str | AttachBase | AppriseAttachment]`, found `AttachBase | None`
+ tests/test_apprise_attachments.py:194:9 error[invalid-argument-type] Argument to bound method `AppriseAttachment.add` is incorrect: Expected `str | AttachBase | AppriseAttachment | list[str | AttachBase | AppriseAttachment]`, found `AttachBase | None`
+ tests/test_apprise_attachments.py:201:9 error[invalid-argument-type] Argument to bound method `AppriseAttachment.add` is incorrect: Expected `str | AttachBase | AppriseAttachment | list[str | AttachBase | AppriseAttachment]`, found `AttachBase | None`
+ tests/test_apprise_attachments.py:202:51 error[invalid-argument-type] Argument to function `AppriseAttachment.instantiate` is incorrect: Expected `int | None`, found `Literal["invalid"]`
+ tests/test_apprise_attachments.py:213:19 error[invalid-argument-type] Argument to bound method `AppriseAttachment.add` is incorrect: Expected `str | AttachBase | AppriseAttachment | list[str | AttachBase | AppriseAttachment]`, found `None`
+ tests/test_apprise_attachments.py:214:19 error[invalid-argument-type] Argument to bound method `AppriseAttachment.add` is incorrect: Expected `str | AttachBase | AppriseAttachment | list[str | AttachBase | AppriseAttachment]`, found `object`
+ tests/test_apprise_attachments.py:215:19 error[invalid-argument-type] Argument to bound method `AppriseAttachment.add` is incorrect: Expected `str | AttachBase | AppriseAttachment | list[str | AttachBase | AppriseAttachment]`, found `Literal[42]`
+ tests/test_apprise_attachments.py:229:19 error[invalid-argument-type] Argument to bound method `AppriseAttachment.add` is incorrect: Expected `str | AttachBase | AppriseAttachment | list[str | AttachBase | AppriseAttachment]`, found `tuple[None, object, Literal[42], Literal["garbage://"]]`
+ tests/test_apprise_attachments.py:247:12 error[invalid-argument-type] Argument to bound method `AppriseAttachment.add` is incorrect: Expected `str | AttachBase | AppriseAttachment | list[str | AttachBase | AppriseAttachment]`, found `tuple[None, object, Literal[42], Literal["garbage://"]]`
+ tests/test_apprise_attachments.py:258:12 error[invalid-argument-type] Argument to bound method `AppriseAttachment.add` is incorrect: Expected `str | AttachBase | AppriseAttachment | list[str | AttachBase | AppriseAttachment]`, found `tuple[None, object, Literal[42], Literal["garbage://"]]`
+ tests/test_apprise_cli.py:2397:13 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ tests/test_apprise_cli.py:2400:19 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ tests/test_apprise_config.py:623:18 error[invalid-argument-type] Argument to bound method `Apprise.add` is incorrect: Expected `str | dict[Unknown, Unknown] | NotifyBase | ... omitted 3 union elements`, found `object`
+ tests/test_apprise_config.py:624:18 error[invalid-argument-type] Argument to bound method `Apprise.add` is incorrect: Expected `str | dict[Unknown, Unknown] | NotifyBase | ... omitted 3 union elements`, found `list[object]`
- tests/test_apprise_config.py:1323:12 error[unsupported-operator] Operator `in` is not supported between objects of type `Literal["[email protected]"]` and `ExactlySized[Literal[2]]`
+ tests/test_apprise_config.py:1323:12 error[unsupported-operator] Operator `in` is not supported between objects of type `Literal["[email protected]"]` and `object`
- tests/test_apprise_config.py:1325:12 error[unsupported-operator] Operator `in` is not supported between objects of type `Literal["[email protected], [email protected]   \t"]` and `ExactlySized[Literal[2]]`
+ tests/test_apprise_config.py:1325:12 error[unsupported-operator] Operator `in` is not supported between objects of type `Literal["[email protected], [email protected]   \t"]` and `object`
- tests/test_apprise_config.py:1359:12 error[unsupported-operator] Operator `in` is not supported between objects of type `Literal["[email protected]"]` and `ExactlySized[Literal[3]]`
+ tests/test_apprise_config.py:1359:12 error[unsupported-operator] Operator `in` is not supported between objects of type `Literal["[email protected]"]` and `object`
- tests/test_apprise_config.py:1360:12 error[unsupported-operator] Operator `in` is not supported between objects of type `Literal["[email protected]"]` and `ExactlySized[Literal[3]]`
+ tests/test_apprise_config.py:1360:12 error[unsupported-operator] Operator `in` is not supported between objects of type `Literal["[email protected]"]` and `object`
- tests/test_apprise_config.py:1361:12 error[unsupported-operator] Operator `in` is not supported between objects of type `Literal["[email protected]"]` and `ExactlySized[Literal[3]]`
+ tests/test_apprise_config.py:1361:12 error[unsupported-operator] Operator `in` is not supported between objects of type `Literal["[email protected]"]` and `object`
+ tests/test_apprise_utils.py:2740:9 error[not-subscriptable] Cannot delete subscript on object of type `None` with no `__delitem__` method
+ tests/test_apprise_utils.py:2767:9 error[not-subscriptable] Cannot delete subscript on object of type `None` with no `__delitem__` method
+ tests/test_apprise_utils.py:2768:9 error[not-subscriptable] Cannot delete subscript on object of type `None` with no `__delitem__` method
+ tests/test_apprise_utils.py:2792:9 error[not-subscriptable] Cannot delete subscript on object of type `None` with no `__delitem__` method
+ tests/test_apprise_utils.py:2838:9 error[not-subscriptable] Cannot delete subscript on object of type `None` with no `__delitem__` method
+ tests/test_apprise_utils.py:2839:9 error[not-subscriptable] Cannot delete subscript on object of type `None` with no `__delitem__` method
+ tests/test_apprise_utils.py:2840:9 error[not-subscriptable] Cannot delete subscript on object of type `None` with no `__delitem__` method
+ tests/test_attach_file.py:270:12 error[unresolved-attribute] Attribute `download` is not defined on `None` in union `AttachBase | None`
+ tests/test_attach_file.py:272:9 error[invalid-assignment] Object of type `Literal[True]` is not assignable to attribute `cache` on type `AttachBase | None`
+ tests/test_attach_file.py:274:24 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `AttachBase | None`
- tests/test_config_base.py:522:22 error[invalid-argument-type] Argument to bound method `Apprise.add` is incorrect: Expected `str | dict[Unknown, Unknown] | NotifyBase | ... omitted 3 union elements`, found `list[object] & ExactlySized[Literal[4]]`
+ tests/test_config_base.py:522:22 error[invalid-argument-type] Argument to bound method `Apprise.add` is incorrect: Expected `str | dict[Unknown, Unknown] | NotifyBase | ... omitted 3 union elements`, found `list[object]`
- tests/test_config_base.py:1466:22 error[invalid-argument-type] Argument to bound method `Apprise.add` is incorrect: Expected `str | dict[Unknown, Unknown] | NotifyBase | ... omitted 3 union elements`, found `list[object] & ExactlySized[Literal[4]]`
+ tests/test_config_base.py:1466:22 error[invalid-argument-type] Argument to bound method `Apprise.add` is incorrect: Expected `str | dict[Unknown, Unknown] | NotifyBase | ... omitted 3 union elements`, found `list[object]`
- tests/test_config_base.py:1581:22 error[invalid-argument-type] Argument to bound method `Apprise.add` is incorrect: Expected `str | dict[Unknown, Unknown] | NotifyBase | ... omitted 3 union elements`, found `list[object] & ExactlySized[Literal[4]]`
+ tests/test_config_base.py:1581:22 error[invalid-argument-type] Argument to bound method `Apprise.add` is incorrect: Expected `str | dict[Unknown, Unknown] | NotifyBase | ... omitted 3 union elements`, found `list[object]`
+ tests/test_plugin_africas_talking.py:207:12 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `NotifyBase | None`
+ tests/test_plugin_africas_talking.py:213:26 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `NotifyBase | None`
+ tests/test_plugin_africas_talking.py:231:9 error[unresolved-attribute] Attribute `notify` is not defined on `None` in union `NotifyBase | None`
+ tests/test_plugin_bulksms.py:246:12 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `NotifyBase | None`
+ tests/test_plugin_bulksms.py:254:26 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `NotifyBase | None`
+ tests/test_plugin_bulkvs.py:217:12 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `NotifyBase | None`
+ tests/test_plugin_bulkvs.py:221:26 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `NotifyBase | None`
+ tests/test_plugin_fortysixelks.py:160:12 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `NotifyBase | None`
+ tests/test_plugin_httpsms.py:200:12 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `NotifyBase | None`
+ tests/test_plugin_sms_manager.py:193:12 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `NotifyBase | None`
+ tests/test_plugin_sms_manager.py:199:26 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `NotifyBase | None`
+ tests/test_plugin_sms_manager.py:213:9 error[unresolved-attribute] Attribute `notify` is not defined on `None` in union `NotifyBase | None`
- tests/test_plugin_title_maxlen.py:84:14 error[invalid-argument-type] Argument to bound method `Apprise.add` is incorrect: Expected `str | dict[Unknown, Unknown] | NotifyBase | ... omitted 3 union elements`, found `list[object] & ExactlySized[Literal[2]]`
+ tests/test_plugin_title_maxlen.py:84:14 error[invalid-argument-type] Argument to bound method `Apprise.add` is incorrect: Expected `str | dict[Unknown, Unknown] | NotifyBase | ... omitted 3 union elements`, found `list[object]`
- tests/test_plugin_title_maxlen.py:135:14 error[invalid-argument-type] Argument to bound method `Apprise.add` is incorrect: Expected `str | dict[Unknown, Unknown] | NotifyBase | ... omitted 3 union elements`, found `list[object] & ExactlySized[Literal[2]]`
+ tests/test_plugin_title_maxlen.py:135:14 error[invalid-argument-type] Argument to bound method `Apprise.add` is incorrect: Expected `str | dict[Unknown, Unknown] | NotifyBase | ... omitted 3 union elements`, found `list[object]`

artigraph (https://github.com/artigraph/artigraph)
- src/arti/types/python.py:158:83 error[invalid-argument-type] Argument is incorrect: Expected `frozenset[Any]`, found `tuple[Any, ...] & ~ExactlySized[Literal[0, False]]`
+ src/arti/types/python.py:158:83 error[invalid-argument-type] Argument is incorrect: Expected `frozenset[Any]`, found `tuple[Any, ...]`

beartype (https://github.com/beartype/beartype)
- beartype/_util/hint/pep/proposal/pep484/pep484604union.py:298:45 error[invalid-argument-type] Argument to function `make_hint_pep484_union` is incorrect: Expected `tuple[TypeForm[Any], ...]`, found `(Sequence[TypeForm[Any]] & tuple[object, ...] & ~AlwaysFalsy & ~ExactlySized[Literal[1, True]]) | tuple[TypeForm[Any], ...]`
+ beartype/_util/hint/pep/proposal/pep484/pep484604union.py:298:45 error[invalid-argument-type] Argument to function `make_hint_pep484_union` is incorrect: Expected `tuple[TypeForm[Any], ...]`, found `(Sequence[TypeForm[Any]] & tuple[object, ...] & ~AlwaysFalsy) | tuple[TypeForm[Any], ...]`

colour (https://github.com/colour-science/colour)
- colour/io/uprtek_sekonic.py:421:33 error[invalid-argument-type] Argument to constructor `float.__new__` is incorrect: Expected `str | Buffer | SupportsFloat | SupportsIndex`, found `str | (list[str] & ~ExactlySized[Literal[1, True]])`
+ colour/io/uprtek_sekonic.py:421:33 error[invalid-argument-type] Argument to constructor `float.__new__` is incorrect: Expected `str | Buffer | SupportsFloat | SupportsIndex`, found `str | list[str]`
- colour/io/uprtek_sekonic.py:421:33 error[invalid-argument-type] Argument to constructor `int.__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `str | (list[str] & ~ExactlySized[Literal[1, True]])`
+ colour/io/uprtek_sekonic.py:421:33 error[invalid-argument-type] Argument to constructor `int.__new__` is incorrect: Expected `str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc`, found `str | list[str]`

dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ddtrace/_trace/utils_botocore/span_pointers/dynamodb.py:480:25 warning[redundant-cast] Value is already of type `_DynamoDBDeleteRequestWriteRequest`
+ ddtrace/_trace/utils_botocore/span_pointers/dynamodb.py:551:34 warning[redundant-cast] Value is already of type `_DynamoDBTransactUpdateItem`
+ tests/telemetry/test_dependency.py:110:20 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ tests/telemetry/test_dependency.py:136:16 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ tests/telemetry/test_dependency.py:145:20 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ tests/telemetry/test_dependency.py:146:16 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ tests/telemetry/test_dependency.py:228:16 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ tests/telemetry/test_dependency.py:229:20 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ tests/telemetry/test_dependency.py:248:20 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ tests/telemetry/test_dependency.py:257:16 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ tests/telemetry/test_dependency.py:269:20 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ tests/telemetry/test_dependency.py:282:43 error[not-iterable] Object of type `list[ReachabilityMetadata] | None` may not be iterable
+ tests/telemetry/test_dependency.py:658:16 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ tests/telemetry/test_dependency.py:674:16 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- tests/testing/internal/pytest/test_pytest_efd.py:73:16 error[not-subscriptable] Cannot subscript object of type `ExactlySized[Literal[1, True]]` with no `__getitem__` method
- tests/testing/internal/pytest/test_pytest_efd.py:74:16 error[not-subscriptable] Cannot subscript object of type `ExactlySized[Literal[1, True]]` with no `__getitem__` method
- tests/testing/internal/pytest/test_pytest_efd.py:75:16 error[not-subscriptable] Cannot subscript object of type `ExactlySized[Literal[1, True]]` with no `__getitem__` method
+ tests/tracer/runtime/test_metric_collectors.py:111:16 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ tests/tracer/runtime/test_metric_collectors.py:112:27 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- tests/tracer/test_encoders.py:935:20 error[unresolved-attribute] Object of type `MsgpackEncoderV05 & ExactlySized[Literal[1, True]]` has no attribute `flush`
+ tests/tracer/test_encoders.py:935:20 error[unresolved-attribute] Object of type `MsgpackEncoderV05` has no attribute `flush`

ibis (https://github.com/ibis-project/ibis)
- ibis/backends/polars/__init__.py:299:20 error[not-subscriptable] Cannot subscript object of type `ExactlySized[Literal[1, True]]` with no `__getitem__` method
- ibis/backends/polars/__init__.py:301:54 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `(Iterable[str | Path] & ~ExactlySized[Literal[1, True]] & ~str & ~Path) | (Unknown & ~str & ~Path)`
+ ibis/backends/polars/__init__.py:301:54 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `(Iterable[str | Path] & ~str & ~Path) | (Unknown & ~str & ~Path)`
- ibis/backends/polars/__init__.py:311:39 error[invalid-argument-type] Argument to function `normalize_filename` is incorrect: Expected `str | Path`, found `str | Path | (Iterable[str | Path] & ~ExactlySized[Literal[1, True]]) | Unknown`
+ ibis/backends/polars/__init__.py:311:39 error[invalid-argument-type] Argument to function `normalize_filename` is incorrect: Expected `str | Path`, found `Iterable[str | Path] | Path | Unknown`

jax (https://github.com/google/jax)
- jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:2493:9 error[invalid-argument-type] Argument is incorrect: Expected `ndarray[tuple[Any, ...], dtype[Any]] | Array | None`, found `(P & ExactlySized[Literal[2]]) | None`
+ jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:2493:9 error[invalid-argument-type] Argument is incorrect: Expected `ndarray[tuple[Any, ...], dtype[Any]] | Array | None`, found `P | None`
- jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:2494:9 error[invalid-argument-type] Argument is incorrect: Expected `ndarray[tuple[Any, ...], dtype[Any]] | Array | None`, found `(P & ExactlySized[Literal[2]]) | None`
+ jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:2494:9 error[invalid-argument-type] Argument is incorrect: Expected `ndarray[tuple[Any, ...], dtype[Any]] | Array | None`, found `P | None`
- jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:2495:9 error[invalid-argument-type] Argument is incorrect: Expected `ndarray[tuple[Any, ...], dtype[Any]] | Array | None`, found `(P & ExactlySized[Literal[2]]) | None`
+ jax/experimental/pallas/ops/tpu/splash_attention/splash_attention_kernel.py:2495:9 error[invalid-argument-type] Argument is incorrect: Expected `ndarray[tuple[Any, ...], dtype[Any]] | Array | None`, found `P | None`

meson (https://github.com/mesonbuild/meson)
+ mesonbuild/backend/vs2010backend.py:1246:44 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ mesonbuild/backend/vs2010backend.py:1247:53 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ mesonbuild/backend/vs2010backend.py:1248:16 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `ImmutableListProtocol[str] | None`
+ mesonbuild/backend/vs2010backend.py:1253:49 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ mesonbuild/backend/vs2010backend.py:1254:55 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- mesonbuild/backend/vs2010backend.py:1240:51 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `(ImmutableListProtocol[str] & ~ExactlySized[Literal[1, True]]) | None`
+ mesonbuild/backend/vs2010backend.py:1240:51 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `ImmutableListProtocol[str] | None`

mitmproxy (https://github.com/mitmproxy/mitmproxy)
+ test/mitmproxy/test_eventsequence.py:43:16 error[unresolved-attribute] Attribute `messages` is not defined on `None` in union `WebSocketData | None`
+ test/mitmproxy/test_eventsequence.py:45:16 error[unresolved-attribute] Attribute `messages` is not defined on `None` in union `WebSocketData | None`

optuna (https://github.com/optuna/optuna)
- optuna/storages/_rdb/alembic/versions/v3.0.0.a.py:193:34 error[invalid-argument-type] Argument to function `persist` is incorrect: Expected `list[BaseDistribution]`, found `(list[TrialParamModel] & ExactlySized[Literal[5000]]) | (list[Unknown] & ExactlySized[Literal[5000]])`
+ optuna/storages/_rdb/alembic/versions/v3.0.0.a.py:193:34 error[invalid-argument-type] Argument to function `persist` is incorrect: Expected `list[BaseDistribution]`, found `list[TrialParamModel] | list[Unknown]`
+ tests/storages_tests/rdb_tests/test_storage.py:297:30 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ tests/storages_tests/rdb_tests/test_storage.py:298:29 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- tests/study_tests/test_study.py:1522:47 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- tests/study_tests/test_study.py:1528:48 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive

packaging (https://github.com/pypa/packaging)
+ src/packaging/version.py:786:21 error[invalid-assignment] Object of type `object` is not assignable to attribute `_epoch` of type `int`
+ src/packaging/version.py:787:21 error[invalid-assignment] Object of type `object` is not assignable to attribute `_release` of type `tuple[int, ...]`
+ src/packaging/version.py:788:21 error[invalid-assignment] Object of type `object` is not assignable to attribute `_pre` of type `tuple[Literal["a", "b", "rc"], int] | None`
+ src/packaging/version.py:789:21 error[invalid-assignment] Object of type `object` is not assignable to attribute `_post` of type `tuple[Literal["post"], int] | None`
+ src/packaging/version.py:790:21 error[invalid-assignment] Object of type `object` is not assignable to attribute `_dev` of type `tuple[Literal["dev"], int] | None`
+ src/packaging/version.py:791:21 error[invalid-assignment] Object of type `object` is not assignable to attribute `_local` of type `tuple[int | str, ...] | None`

pandas (https://github.com/pandas-dev/pandas)
- pandas/core/indexers/utils.py:575:23 error[unresolved-attribute] Attribute `to_numpy` is not defined on `ndarray[tuple[Any, ...], dtype[Unknown]]` in union `(Any & ~tuple[object, ...]) | (ExtensionArray & ~ExactlySized[Literal[0, False]]) | ndarray[tuple[Any, ...], dtype[Unknown]]`
+ pandas/core/indexers/utils.py:575:23 error[unresolved-attribute] Attribute `to_numpy` is not defined on `ndarray[tuple[Any, ...], dtype[Unknown]]` in union `(Any & ~tuple[object, ...]) | ExtensionArray | ndarray[tuple[Any, ...], dtype[Unknown]]`
- pandas/core/indexes/multi.py:599:54 error[invalid-argument-type] Argument to function `tuples_to_object_array` is incorrect: Expected `ndarray[tuple[Any, ...], dtype[object_]]`, found `(Collection[tuple[Hashable, ...]] & ndarray[tuple[object, ...], dtype[object]] & ~ExactlySized[Literal[0, False]] & ~Index) | ndarray[tuple[Any, ...], dtype[Any]]`
+ pandas/core/indexes/multi.py:599:54 error[invalid-argument-type] Argument to function `tuples_to_object_array` is incorrect: Expected `ndarray[tuple[Any, ...], dtype[object_]]`, found `(Collection[tuple[Hashable, ...]] & ndarray[tuple[object, ...], dtype[object]] & ~Index) | ndarray[tuple[Any, ...], dtype[Any]]`
- pandas/core/indexes/multi.py:4789:49 error[invalid-argument-type] Argument to bound method `MultiIndex.from_tuples` is incorrect: Expected `Iterable[tuple[Hashable, ...]]`, found `(Unknown & ~Generator[object, None, None] & ~ExactlySized[Literal[0, False]] & ~MultiIndex) | (list[object] & ~ExactlySized[Literal[0, False]] & ~MultiIndex)`
+ pandas/core/indexes/multi.py:4789:49 error[invalid-argument-type] Argument to bound method `MultiIndex.from_tuples` is incorrect: Expected `Iterable[tuple[Hashable, ...]]`, found `(Unknown & ~Generator[object, None, None] & ~MultiIndex) | (list[object] & ~MultiIndex)`
- pandas/core/indexes/range.py:1066:12 error[unresolved-attribute] Object of type `Index & ~ExactlySized[Literal[0, False]] & ~ExactlySized[Literal[1, True]]` has no attribute `step`
+ pandas/core/indexes/range.py:1066:12 error[unresolved-attribute] Object of type `Index` has no attribute `step`
- pandas/core/indexes/range.py:1073:18 error[unresolved-attribute] Object of type `Index & ~ExactlySized[Literal[0, False]] & ~ExactlySized[Literal[1, True]]` has no attribute `_range`
+ pandas/core/indexes/range.py:1073:18 error[unresolved-attribute] Object of type `Index` has no attribute `_range`
- pandas/core/indexes/range.py:1087:16 error[unresolved-attribute] Object of type `Index & ~ExactlySized[Literal[0, False]] & ~ExactlySized[Literal[1, True]]` has no attribute `step`
+ pandas/core/indexes/range.py:1087:16 error[unresolved-attribute] Object of type `Index` has no attribute `step`
- pandas/core/resample.py:3215:12 error[invalid-return-type] Return type does not match returned value: expected `FreqIndexT@_asfreq_compat`, found `(FreqIndexT@_asfreq_compat & ExactlySized[Literal[0, False]] & PeriodIndex) | DatetimeIndex | TimedeltaIndex`
+ pandas/core/resample.py:3215:12 error[invalid-return-type] Return type does not match returned value: expected `FreqIndexT@_asfreq_compat`, found `(FreqIndexT@_asfreq_compat & PeriodIndex) | DatetimeIndex | TimedeltaIndex`
- pandas/core/reshape/concat.py:814:29 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `(Iterable[Series | DataFrame] & ~ExactlySized[Literal[0, False]]) | (Mapping[HashableT@_clean_keys_and_objs, Series | DataFrame] & ~ExactlySized[Literal[0, False]])`
+ pandas/core/reshape/concat.py:814:29 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `Iterable[Series | DataFrame] | Mapping[HashableT@_clean_keys_and_objs, Series | DataFrame]`
- pandas/core/reshape/concat.py:818:66 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `(Iterable[Series | DataFrame] & ~ExactlySized[Literal[0, False]]) | (Mapping[HashableT@_clean_keys_and_objs, Series | DataFrame] & ~ExactlySized[Literal[0, False]])`
+ pandas/core/reshape/concat.py:818:66 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `Iterable[Series | DataFrame] | Mapping[HashableT@_clean_keys_and_objs, Series | DataFrame]`
- pandas/core/reshape/merge.py:1936:16 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `(Hashable & ~None) | (Unknown & ~ExactlySized[Literal[0, False]]) | None`
+ pandas/core/reshape/merge.py:1936:16 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `(Hashable & ~None) | Unknown | None`
- pandas/core/reshape/merge.py:1936:33 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `(Hashable & ~None) | (Unknown & ~ExactlySized[Literal[0, False]]) | None`
+ pandas/core/reshape/merge.py:1936:33 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `(Hashable & ~None) | Unknown | None`
+ pandas/plotting/_matplotlib/boxplot.py:338:14 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ pandas/tests/frame/constructors/test_from_records.py:295:16 error[unsupported-operator] Operator `not in` is not supported between objects of type `Literal["index"]` and `tuple[str, str] | None`
- pandas/tests/indexes/datetimes/test_setops.py:368:16 error[unresolved-attribute] Object of type `Index & ExactlySized[Literal[0, False]]` has no attribute `freq`
+ pandas/tests/indexes/datetimes/test_setops.py:368:16 error[unresolved-attribute] Object of type `Index` has no attribute `freq`

pip (https://github.com/pypa/pip)
+ src/pip/_vendor/packaging/version.py:787:21 error[invalid-assignment] Object of type `object` is not assignable to attribute `_epoch` of type `int`
+ src/pip/_vendor/packaging/version.py:788:21 error[invalid-assignment] Object of type `object` is not assignable to attribute `_release` of type `tuple[int, ...]`
+ src/pip/_vendor/packaging/version.py:789:21 error[invalid-assignment] Object of type `object` is not assignable to attribute `_pre` of type `tuple[Literal["a", "b", "rc"], int] | None`
+ src/pip/_vendor/packaging/version.py:790:21 error[invalid-assignment] Object of type `object` is not assignable to attribute `_post` of type `tuple[Literal["post"], int] | None`
+ src/pip/_vendor/packaging/version.py:791:21 error[invalid-assignment] Object of type `object` is not assignable to attribute `_dev` of type `tuple[Literal["dev"], int] | None`
+ src/pip/_vendor/packaging/version.py:792:21 error[invalid-assignment] Object of type `object` is not assignable to attribute `_local` of type `tuple[int | str, ...] | None`

ppb-vector (https://github.com/ppb/ppb-vector)
+ ppb_vector/__init__.py:189:26 error[invalid-argument-type] Method `__getitem__` of type `Overload[(index: int, /) -> SupportsFloat, (index: slice[int | None, int | None, int | None], /) -> Sequence[SupportsFloat]]` cannot be called with key of type `Literal["x"]` on object of type `Sequence[SupportsFloat]`
+ ppb_vector/__init__.py:189:26 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[Mapping[Unknown, object]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["x"]` on object of type `Top[Mapping[Unknown, object]]`
+ ppb_vector/__init__.py:189:45 error[invalid-argument-type] Method `__getitem__` of type `Overload[(index: int, /) -> SupportsFloat, (index: slice[int | None, int | None, int | None], /) -> Sequence[SupportsFloat]]` cannot be called with key of type `Literal["y"]` on object of type `Sequence[SupportsFloat]`
+ ppb_vector/__init__.py:189:45 error[invalid-argument-type] Method `__getitem__` of type `bound method Top[Mapping[Unknown, object]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["y"]` on object of type `Top[Mapping[Unknown, object]]`

prefect (https://github.com/PrefectHQ/prefect)
- src/integrations/prefect-aws/tests/test_s3.py:932:16 error[not-subscriptable] Cannot subscript object of type `ExactlySized[Literal[1, True]]` with no `__getitem__` method
+ src/integrations/prefect-dbt/tests/core/test_cloud_executor.py:269:16 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ src/integrations/prefect-dbt/tests/core/test_cloud_executor.py:270:16 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- src/integrations/prefect-gcp/prefect_gcp/cloud_storage.py:2051:21 error[not-iterable] Object of type `(list[Unknown] & ~ExactlySized[Literal[0, False]]) | (Coroutine[Any, Any, list[Unknown]] & ~ExactlySized[Literal[0, False]])` may not be iterable
+ src/integrations/prefect-gcp/prefect_gcp/cloud_storage.py:2051:21 error[not-iterable] Object of type `list[Unknown] | Coroutine[Any, Any, list[Unknown]]` may not be iterable
+ src/integrations/prefect-sqlalchemy/tests/test_database.py:529:20 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `dict[str, CursorResult[Unknown]] | None`

pytest (https://github.com/pytest-dev/pytest)
+ testing/test_stash.py:59:9 error[invalid-assignment] Object of type `Literal["nope"]` is not assignable to attribute `foo` on type `Stash & ~AlwaysTruthy & ~AlwaysFalsy`

rotki (https://github.com/rotki/rotki)
- rotkehlchen/chain/aggregator.py:761:37 error[invalid-argument-type] Argument to bound method `ChainsAggregator.query_eth_balances` is incorrect: Expected `Sequence[ChecksumAddress]`, found `(tuple[BTCAddress, ...] & ~ExactlySized[Literal[0, False]]) | (tuple[ChecksumAddress, ...] & ~ExactlySized[Literal[0, False]]) | (tuple[SubstrateAddress, ...] & ~ExactlySized[Literal[0, False]]) | ... omitted 5 union elements`
+ rotkehlchen/chain/aggregator.py:761:37 error[invalid-argument-type] Argument to bound method `ChainsAggregator.query_eth_balances` is incorrect: Expected `Sequence[ChecksumAddress]`, found `tuple[BTCAddress, ...] | tuple[ChecksumAddress, ...] | tuple[SubstrateAddress, ...] | ... omitted 5 union elements`
+ rotkehlchen/tests/external_apis/test_yearn.py:105:12 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ rotkehlchen/tests/external_apis/test_yearn.py:116:12 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ rotkehlchen/tests/unit/decoders/test_beefy_finance.py:1241:9 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method

scikit-learn (https://github.com/scikit-learn/scikit-learn)
+ sklearn/datasets/_samples_generator.py:876:39 error[not-iterable] Object of type `Literal[100]` is not iterable

scipy (https://github.com/scipy/scipy)
+ scipy/sparse/_base.py:101:20 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method

scrapy (https://github.com/scrapy/scrapy)
+ tests/test_pqueues.py:34:16 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `Request | None`
+ tests/test_pqueues.py:35:16 error[unresolved-attribute] Attribute `priority` is not defined on `None` in union `Request | None`
+ tests/test_pqueues.py:69:16 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `Request | None`
+ tests/test_pqueues.py:70:16 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `Request | None`
+ tests/test_pqueues.py:72:16 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `Request | None`
+ tests/test_pqueues.py:73:16 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `Request | None`
+ tests/test_pqueues.py:75:16 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `Request | None`
+ tests/test_pqueues.py:76:16 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `Request | None`
+ tests/test_pqueues.py:95:16 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `Request | None`
+ tests/test_pqueues.py:96:16 error[unresolved-attribute] Attribute `priority` is not defined on `None` in union `Request | None`
+ tests/test_pqueues.py:123:16 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `Request | None`
+ tests/test_pqueues.py:125:16 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `Request | None`
+ tests/test_pqueues.py:127:16 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `Request | None`
+ tests/test_pqueues.py:152:16 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `Request | None`
+ tests/test_pqueues.py:153:16 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `Request | None`
+ tests/test_pqueues.py:155:16 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `Request | None`
+ tests/test_pqueues.py:156:16 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `Request | None`
+ tests/test_pqueues.py:158:16 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `Request | None`
+ tests/test_pqueues.py:159:16 error[unresolved-attribute] Attribute `url` is not defined on `None` in union `Request | None`

setuptools (https://github.com/pypa/setuptools)
- setuptools/_vendor/packaging/version.py:268:16 error[invalid-return-type] Return type does not match returned value: expected `tuple[Literal["a", "b", "rc"], int] | None`, found `tuple[object, ...] & ExactlySized[Literal[2]]`
+ setuptools/_vendor/packaging/version.py:268:16 error[invalid-return-type] Return type does not match returned value: expected `tuple[Literal["a", "b", "rc"], int] | None`, found `tuple[object, object]`

spack (https://github.com/spack/spack)
- lib/spack/spack/graph.py:132:31 error[unsupported-operator] Operator `in` is not supported between objects of type `Unknown & ExactlySized[Literal[1, True]]` and `None | list[list[Unknown]]`
+ lib/spack/spack/graph.py:132:31 error[unsupported-operator] Operator `in` is not supported between objects of type `Unknown` and `None | list[list[Unknown]]`
+ lib/spack/spack/test/cmd/uninstall.py:126:36 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ lib/spack/spack/test/cmd/uninstall.py:129:36 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ lib/spack/spack/test/cmd/uninstall.py:132:36 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
+ lib/spack/spack/test/cmd/uninstall.py:135:36 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method

sympy (https://github.com/sympy/sympy)
- sympy/integrals/heurisch.py:200:22 error[invalid-argument-type] Argument to bound method `list.append` is incorrect: Expected `tuple[Unknown, Boolean]`, found `tuple[Unknown, Literal[True]]`
- sympy/matrices/tests/test_eigen.py:201:12 error[unresolved-attribute] Object of type `dict[Expr, int] & ExactlySized[Literal[3]]` has no attribute `count`
+ sympy/matrices/tests/test_eigen.py:201:12 error[unresolved-attribute] Object of type `dict[Expr, int]` has no attribute `count`
- sympy/matrices/tests/test_eigen.py:202:12 error[unresolved-attribute] Object of type `dict[Expr, int] & ExactlySized[Literal[3]]` has no attribute `count`
+ sympy/matrices/tests/test_eigen.py:202:12 error[unresolved-attribute] Object of type `dict[Expr, int]` has no attribute `count`
- sympy/polys/tests/test_polymatrix.py:60:17 error[invalid-argument-type] Argument to `list.__init__` is incorrect: Expected `Iterable[Unknown]`, found `MutablePolyDenseMatrix & ExactlySized[Literal[2]]`
+ sympy/polys/tests/test_polymatrix.py:60:17 error[invalid-argument-type] Argument to `list.__init__` is incorrect: Expected `Iterable[Unknown]`, found `MutablePolyDenseMatrix`
- sympy/polys/tests/test_polymatrix.py:70:17 error[invalid-argument-type] Argument to `list.__init__` is incorrect: Expected `Iterable[Unknown]`, found `MutablePolyDenseMatrix & ExactlySized[Literal[2]]`
+ sympy/polys/tests/test_polymatrix.py:70:17 error[invalid-argument-type] Argument to `list.__init__` is incorrect: Expected `Iterable[Unknown]`, found `MutablePolyDenseMatrix`
- sympy/sets/sets.py:2514:17 error[unresolved-attribute] Attribute `args` is not defined on `dict[Any, Any] & ExactlySized[Literal[1, True]] & ~AlwaysFalsy` in union `(Any & ExactlySized[Literal[1, True]] & ~AlwaysFalsy) | (dict[Any, Any] & ExactlySized[Literal[1, True]] & ~AlwaysFalsy)`
+ sympy/sets/sets.py:2514:17 error[unresolved-attribute] Attribute `args` is not defined on `dict[Any, Any] & ~AlwaysFalsy` in union `(Any & ~AlwaysFalsy) | (dict[Any, Any] & ~AlwaysFalsy)`
- sympy/solvers/decompogen.py:74:16 error[unsupported-operator] Operator `+` is not supported between objects of type `list[Unknown]` and `None | Unknown | list[Unknown]`
+ sympy/solvers/decompogen.py:74:16 error[unsupported-operator] Operator `+` is not supported between objects of type `list[Unknown]` and `None | Unknown`
- sympy/stats/stochastic_process_types.py:668:26 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `Union & ~ExactlySized[Literal[1, True]]`
+ sympy/stats/stochastic_process_types.py:668:26 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `Union`
- sympy/tensor/array/tests/test_immutable_ndim_array.py:150:16 error[unresolved-attribute] Object of type `ImmutableSparseNDimArray & ExactlySized[Literal[4]]` has no attribute `_sparse_array`
+ sympy/tensor/array/tests/test_immutable_ndim_array.py:150:16 error[unresolved-attribute] Object of type `ImmutableSparseNDimArray` has no attribute `_sparse_array`
- sympy/tensor/array/tests/test_immutable_ndim_array.py:160:16 error[unresolved-attribute] Object of type `ImmutableSparseNDimArray & ExactlySized[Literal[4]]` has no attribute `_sparse_array`
+ sympy/tensor/array/tests/test_immutable_ndim_array.py:160:16 error[unresolved-attribute] Object of type `ImmutableSparseNDimArray` has no attribute `_sparse_array`
- sympy/tensor/array/tests/test_immutable_ndim_array.py:162:16 error[unresolved-attribute] Object of type `ImmutableSparseNDimArray & ExactlySized[Literal[4]]` has no attribute `_sparse_array`
+ sympy/tensor/array/tests/test_immutable_ndim_array.py:162:16 error[unresolved-attribute] Object of type `ImmutableSparseNDimArray` has no attribute `_sparse_array`
- sympy/tensor/array/tests/test_mutable_ndim_array.py:147:16 error[unresolved-attribute] Object of type `MutableSparseNDimArray & ExactlySized[Literal[4]]` has no attribute `_sparse_array`
+ sympy/tensor/array/tests/test_mutable_ndim_array.py:147:16 error[unresolved-attribute] Object of type `MutableSparseNDimArray` has no attribute `_sparse_array`
- sympy/tensor/array/tests/test_mutable_ndim_array.py:155:16 error[unresolved-attribute] Object of type `MutableSparseNDimArray & ExactlySized[Literal[4]]` has no attribute `_sparse_array`
+ sympy/tensor/array/tests/test_mutable_ndim_array.py:155:16 error[unresolved-attribute] Object of type `MutableSparseNDimArray` has no attribute `_sparse_array`
- sympy/tensor/array/tests/test_mutable_ndim_array.py:162:16 error[unresolved-attribute] Object of type `MutableSparseNDimArray & ExactlySized[Literal[4]]` has no attribute `_sparse_array`
+ sympy/tensor/array/tests/test_mutable_ndim_array.py:162:16 error[unresolved-attribute] Object of type `MutableSparseNDimArray` has no attribute `_sparse_array`
- sympy/tensor/array/tests/test_mutable_ndim_array.py:164:16 error[unresolved-attribute] Object of type `MutableSparseNDimArray & ExactlySized[Literal[4]]` has no attribute `_sparse_array`
+ sympy/tensor/array/tests/test_mutable_ndim_array.py:164:16 error[unresolved-attribute] Object of type `MutableSparseNDimArray` has no attribute `_sparse_array`
- sympy/vector/basisdependent.py:225:9 error[invalid-assignment] Object of type `dict[Unknown, Divergent] & ~ExactlySized[Literal[0, False]]` is not assignable to attribute `_components` on type `Expr & ~Mul`
+ sympy/vector/basisdependent.py:225:9 error[invalid-assignment] Object of type `dict[Unknown, Divergent]` is not assignable to attribute `_components` on type `Expr & ~Mul`

vision (https://github.com/pytorch/vision)
- test/test_functional_tensor.py:112:107 error[invalid-argument-type] Argument to function `rotate` is incorrect: Expected `list[int | float] | None`, found `int | (Unknown & ~ExactlySized[Literal[1, True]])`
+ test/test_functional_tensor.py:112:107 error[invalid-argument-type] Argument to function `rotate` is incorrect: Expected `list[int | float] | None`, found `int | Unknown`
- test/test_functional_tensor.py:316:105 error[invalid-argument-type] Argument to function `affine` is incorrect: Expected `list[int | float] | None`, found `int | (Unknown & ~ExactlySized[Literal[1, True]])`
+ test/test_functional_tensor.py:316:105 error[invalid-argument-type] Argument to function `affine` is incorrect: Expected `list[int | float] | None`, found `int | Unknown`
- test/test_functional_tensor.py:395:87 error[invalid-argument-type] Argument to function `perspective` is incorrect: Expected `list[int | float] | None`, found `int | (Unknown & ~ExactlySized[Literal[1, True]])`
+ test/test_functional_tensor.py:395:87 error[invalid-argument-type] Argument to function `perspective` is incorrect: Expected `list[int | float] | None`, found `int | Unknown`

werkzeug (https://github.com/pallets/werkzeug)
- tests/test_datastructures.py:690:16 error[unsupported-operator] Operator `not in` is not supported between objects of type `Literal[42]` and `EnvironHeaders & ExactlySized[Literal[3]] & ~AlwaysFalsy`
+ tests/test_datastructures.py:690:16 error[unsupported-operator] Operator `not in` is not supported between objects of type `Literal[42]` and `EnvironHeaders & ~AlwaysFalsy`

xarray (https://github.com/pydata/xarray)
- xarray/core/extension_array.py:195:54 error[not-subscriptable] Cannot subscript object of type `ExactlySized[Literal[1, True]]` with no `__getitem__` method
+ xarray/core/extension_array.py:195:54 error[not-subscriptable] Cannot subscript object of type `object` with no `__getitem__` method

zulip (https://github.com/zulip/zulip)
- zerver/lib/event_schema.py:409:29 error[not-subscriptable] Cannot subscript object of type `ExactlySized[Literal[1, True]]` with no `__getitem__` method
+ zerver/lib/event_schema.py:409:29 error[not-subscriptable] Cannot subscript object of type `object` with no `__getitem__` method
- zerver/lib/event_schema.py:412:29 error[not-subscriptable] Cannot subscript object of type `ExactlySized[Literal[1, True]]` with no `__getitem__` method
+ zerver/lib/event_schema.py:412:29 error[not-subscriptable] Cannot subscript object of type `object` with no `__getitem__` method

Full report with detailed diff (timing results)

@carljm carljm marked this pull request as ready for review June 10, 2026 20:58
@carljm carljm assigned AlexWaygood and charliermarsh and unassigned sharkdp Jun 10, 2026
@carljm carljm merged commit 5ffba80 into main Jun 10, 2026
59 checks passed
@carljm carljm deleted the cjm/3710-restrict-lengthbased-narrowing branch June 10, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

length assertions incorrectly mark code as unreachable

4 participants