Skip to content

[ty] Infer collection types from augmented subscript stores - #27546

Draft
charliermarsh wants to merge 7 commits into
charlie/ty-2175-augmented-assignment-storesfrom
charlie/ty-2175-augmented-collection-inference
Draft

[ty] Infer collection types from augmented subscript stores#27546
charliermarsh wants to merge 7 commits into
charlie/ty-2175-augmented-assignment-storesfrom
charlie/ty-2175-augmented-collection-inference

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Aug 6, 2026

Copy link
Copy Markdown
Member

Summary

Stacked on #27545.

We already infer unannotated collection element types from later method calls and ordinary subscript assignments, but augmented subscript assignments did not contribute the value produced by their operator:

values = [1]
values[0] /= 2
reveal_type(values)  # list[float]

We now index augmented single-element stores as constraining collection uses and infer their constraints from the value actually passed to __setitem__. Provisional mismatches can widen inferred lists and dictionaries, including empty constructors, while explicit annotations and rejected ordinary writes retain their existing contracts.

We also include augmented attribute assignments when inferring public instance-attribute types and validate augmented stores through the same statement-level attribute and subscript machinery as ordinary assignments. This removes receiver-, key-, descriptor-, and assignment-kind-specific workarounds while preserving existing recovery and cycle handling.

Augmented slice assignments and nested-collection inference through comprehensions remain out of scope.

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

astral-sh-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 96.96%. The percentage of expected errors that received a diagnostic held steady at 92.96%. The number of fully passing files held steady at 106/133.

@astral-sh-bot

astral-sh-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

Memory usage report

Summary

Project Old New Diff Outcome
sphinx 208.34MB 208.53MB +0.09% (199.00kB)
prefect 667.92MB 667.95MB +0.00% (31.79kB)
trio 94.66MB 94.67MB +0.01% (11.55kB)
flake8 40.42MB 40.42MB +0.00% (616.00B)

Significant changes

Click to expand detailed breakdown

sphinx

Name Old New Diff Outcome
infer_definition_types 14.06MB 14.12MB +0.41% (59.36kB)
infer_statement_types_impl 546.05kB 592.14kB +8.44% (46.08kB)
infer_expression_types_impl 16.83MB 16.86MB +0.17% (29.32kB)
all_narrowing_constraints_for_expression 2.61MB 2.62MB +0.33% (8.88kB)
Type<'db>::apply_specialization_inner_::interned_arguments 2.02MB 2.03MB +0.37% (7.73kB)
loop_header_reachability 247.84kB 254.73kB +2.78% (6.89kB)
Type<'db>::apply_specialization_inner_ 1.28MB 1.29MB +0.36% (4.77kB)
Specialization 1.88MB 1.89MB +0.18% (3.50kB)
analyze_non_terminal_call 685.45kB 688.90kB +0.50% (3.45kB)
TypePair 2.71MB 2.71MB +0.12% (3.38kB)
FunctionType 2.16MB 2.16MB +0.15% (3.37kB)
member_lookup_with_policy_inner 5.36MB 5.36MB +0.05% (2.56kB)
MemberLookupKey 3.43MB 3.43MB +0.05% (1.73kB)
infer_scope_types_impl 8.42MB 8.42MB +0.02% (1.67kB)
TypeVarInference 411.91kB 413.39kB +0.36% (1.48kB)
... 29 more

prefect

Name Old New Diff Outcome
infer_scope_types_impl 36.01MB 36.02MB +0.02% (6.76kB)
member_lookup_with_policy_inner 14.54MB 14.55MB +0.04% (6.53kB)
infer_definition_types 60.42MB 60.42MB +0.01% (5.49kB)
MemberLookupKey 9.95MB 9.95MB +0.03% (3.05kB)
Type<'db>::class_member_with_policy_inner_ 12.50MB 12.51MB +0.02% (2.13kB)
Type<'db>::apply_specialization_inner_::interned_arguments 7.30MB 7.30MB +0.02% (1.56kB)
StaticClassLiteral<'db>::try_mro_ 6.88MB 6.88MB +0.02% (1.23kB)
Type<'db>::apply_specialization_inner_ 4.90MB 4.90MB +0.02% (968.00B)
FunctionType 9.63MB 9.63MB +0.01% (824.00B)
Specialization 6.52MB 6.53MB +0.01% (784.00B)
StaticClassLiteral<'db>::try_mro_::interned_arguments 2.14MB 2.15MB +0.02% (360.00B)
TypeVarInference 1.47MB 1.47MB +0.02% (288.00B)
GenericAlias 2.58MB 2.58MB +0.01% (288.00B)
FunctionType<'db>::signature_ 6.30MB 6.30MB +0.00% (264.00B)
infer_expression_types_impl 47.16MB 47.16MB +0.00% (216.00B)
... 10 more

trio

Name Old New Diff Outcome
infer_definition_types 4.51MB 4.51MB +0.07% (3.30kB)
infer_expression_types_impl 5.32MB 5.32MB +0.05% (2.52kB)
infer_scope_types_impl 2.99MB 2.99MB +0.03% (1.05kB)
member_lookup_with_policy_inner 1.45MB 1.45MB +0.07% (1.03kB)
MemberLookupKey 1.15MB 1.15MB +0.08% (936.00B)
Type<'db>::class_member_with_policy_inner_ 1.17MB 1.17MB +0.07% (824.00B)
StringLiteralType 540.39kB 541.02kB +0.12% (640.00B)
loop_header_reachability 79.08kB 79.52kB +0.56% (456.00B)
analyze_non_terminal_call 423.22kB 423.66kB +0.11% (456.00B)
all_narrowing_constraints_for_expression 642.02kB 642.31kB +0.05% (304.00B)
Type<'db>::is_data_descriptor_impl_::interned_arguments 13.75kB 13.83kB +0.57% (80.00B)
Type<'db>::is_data_descriptor_impl_ 7.32kB 7.36kB +0.53% (40.00B)

flake8

Name Old New Diff Outcome
infer_definition_types 1.07MB 1.07MB +0.03% (352.00B)
infer_scope_types_impl 541.95kB 542.21kB +0.05% (264.00B)

@astral-sh-bot

astral-sh-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

Lint rule Added Removed Changed
unresolved-attribute 52 34 5
invalid-assignment 47 0 0
unused-type-ignore-comment 0 11 0
unsupported-operator 0 0 7
invalid-argument-type 1 0 0
Total 100 45 12

Flaky changes detected. This PR summary excludes flaky changes; see the HTML report for details.

Raw diff (157 changes)
aiohttp-devtools (https://github.com/aio-libs/aiohttp-devtools)
+ aiohttp_devtools/runserver/serve.py:90:56 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `bytes | bytearray | Payload | None`

apprise (https://github.com/caronc/apprise)
+ apprise/plugins/telegram.py:1963:13 error[invalid-assignment] Cannot assign to a subscript on an object of type `None`

cki-lib (https://gitlab.com/cki-project/cki-lib)
+ cki_lib/retrying.py:53:21 error[unresolved-attribute] Unresolved attribute `failed_count` on type `_Wrapped[(...), object, (*args: object, **kwargs: object), object]`

dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ddtrace/contrib/internal/unittest/patch.py:885:5 error[unresolved-attribute] Unresolved attribute `_datadog_expected_sessions` on type `<class 'CIVisibility'>`.
+ ddtrace/contrib/internal/unittest/patch.py:889:9 error[unresolved-attribute] Unresolved attribute `_datadog_finished_sessions` on type `<class 'CIVisibility'>`.
+ ddtrace/contrib/internal/unittest/patch.py:894:5 error[unresolved-attribute] Unresolved attribute `_datadog_finished_sessions` on type `<class 'CIVisibility'>`.
- ddtrace/internal/telemetry/writer.py:323:12 error[unsupported-operator] Operator `>` is not supported between objects of type `float` and `EnvVariable[float]`
+ ddtrace/internal/telemetry/writer.py:323:12 error[unsupported-operator] Operator `>` is not supported between objects of type `float | Unknown` and `EnvVariable[float]`
+ scripts/ddtrace_module_graph.py:217:13 error[invalid-assignment] Invalid subscript assignment with key of type `str | None` and value of type `int` on object of type `defaultdict[str, int]`
+ scripts/ddtrace_module_graph.py:219:17 error[invalid-assignment] Invalid subscript assignment with key of type `tuple[str | None, str | None]` and value of type `int` on object of type `defaultdict[tuple[str, str], int]`
+ tests/tracer/test_endpoint_config.py:17:5 error[unresolved-attribute] Unresolved attribute `call_count` on type `def mock_getresponse_enabled_after_4_retries(self) -> Unknown`

graphql-core (https://github.com/graphql-python/graphql-core)
- tests/pyutils/test_inspect.py:28:46 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- tests/pyutils/test_inspect.py:32:50 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- tests/pyutils/test_inspect.py:37:39 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- tests/pyutils/test_inspect.py:41:44 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- tests/pyutils/test_inspect.py:46:40 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- tests/pyutils/test_inspect.py:50:45 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive

ignite (https://github.com/pytorch/ignite)
+ tests/ignite/metrics/nlp/_pyrouge.py:388:25 error[invalid-assignment] Invalid subscript assignment with key of type `str` and value of type `Unknown` on object of type `list[dict[str, list[Unknown]]]`
+ tests/ignite/metrics/nlp/_pyrouge.py:403:29 error[invalid-assignment] Invalid subscript assignment with key of type `str` and value of type `Unknown` on object of type `list[dict[str, list[Unknown]]]`
+ tests/ignite/metrics/nlp/_pyrouge.py:418:21 error[invalid-assignment] Invalid subscript assignment with key of type `str` and value of type `float | Unknown` on object of type `list[dict[str, list[Unknown]]]`
+ tests/ignite/metrics/nlp/_pyrouge.py:466:21 error[invalid-assignment] Invalid subscript assignment with key of type `str` and value of type `Unknown` on object of type `list[dict[str, list[Unknown]]]`
+ tests/ignite/metrics/nlp/_pyrouge.py:494:25 error[invalid-assignment] Invalid subscript assignment with key of type `str` and value of type `Unknown` on object of type `list[dict[str, list[Unknown]]]`
+ tests/ignite/metrics/nlp/_pyrouge.py:509:17 error[invalid-assignment] Invalid subscript assignment with key of type `str` and value of type `float | Unknown` on object of type `list[dict[str, list[Unknown]]]`

manticore (https://github.com/trailofbits/manticore)
+ manticore/platforms/decree.py:1125:13 error[unresolved-attribute] Unresolved attribute `random` on type `<class 'DecreeEmu'>`.
- manticore/platforms/evm.py:2982:9 error[unresolved-attribute] Object of type `Self@add_refund` has no attribute `_refund`
- manticore/platforms/evm.py:2985:9 error[unresolved-attribute] Object of type `Self@sub_refund` has no attribute `_refund`
+ scripts/binaryninja/manticore_viz/__init__.py:149:13 error[invalid-assignment] Invalid subscript assignment with key of type `Literal[0]` and value of type `float` on object of type `list[int]`
+ scripts/binaryninja/manticore_viz/__init__.py:151:17 error[invalid-assignment] Invalid subscript assignment with key of type `Literal[0]` and value of type `float` on object of type `list[int]`
+ tests/native/test_armv7unicorn.py:1518:9 error[invalid-assignment] Object of type `Unknown` is not assignable to attribute `STACK` on type `None | Unknown`
+ tests/native/test_armv7unicorn.py:1527:9 error[invalid-assignment] Object of type `Unknown` is not assignable to attribute `STACK` on type `None | Unknown`

meson (https://github.com/mesonbuild/meson)
+ mesonbuild/mformat.py:312:13 error[invalid-assignment] Object of type `str` is not assignable to attribute `value` on type `WhitespaceNode | None`
+ mesonbuild/mformat.py:444:13 error[invalid-assignment] Object of type `Unknown` is not assignable to attribute `value` on type `WhitespaceNode | None`
+ mesonbuild/mformat.py:489:9 error[invalid-assignment] Object of type `Unknown` is not assignable to attribute `value` on type `WhitespaceNode | None`
+ mesonbuild/mformat.py:499:13 error[invalid-assignment] Object of type `Unknown` is not assignable to attribute `value` on type `WhitespaceNode | None`
+ mesonbuild/mformat.py:501:13 error[invalid-assignment] Object of type `Unknown` is not assignable to attribute `value` on type `WhitespaceNode | None`

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ pymongo/ssl_support.py:120:13 error[invalid-assignment] Object of type `int | Any` is not assignable to attribute `options` on type `pymongo.pyopenssl_context.SSLContext | ssl.SSLContext`
+ pymongo/ssl_support.py:121:13 error[invalid-assignment] Object of type `int | Any` is not assignable to attribute `options` on type `pymongo.pyopenssl_context.SSLContext | ssl.SSLContext`
+ pymongo/ssl_support.py:122:13 error[invalid-assignment] Object of type `int | Any` is not assignable to attribute `options` on type `pymongo.pyopenssl_context.SSLContext | ssl.SSLContext`
+ pymongo/ssl_support.py:123:13 error[invalid-assignment] Object of type `Any | int` is not assignable to attribute `options` on type `pymongo.pyopenssl_context.SSLContext | ssl.SSLContext`

pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/arrays/sparse/array.py:1014:17 error[invalid-assignment] Invalid subscript assignment with key of type `ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]] | ExtensionArray | ndarray[tuple[Any, ...], dtype[Any]] | Any` and value of type `ndarray[tuple[Any, ...], dtype[signedinteger[_64Bit]]] | Unknown` on object of type `ndarray[tuple[Any, ...], dtype[signedinteger[_64Bit]]]`
+ pandas/core/computation/expr.py:295:13 error[unresolved-attribute] Unresolved attribute `unsupported_nodes` on type `type[_T@disallowed]`.
+ pandas/tests/arithmetic/test_datetime64.py:2187:13 error[invalid-assignment] Cannot assign to read-only property `values` on object of type `TimedeltaIndex`: Attempted assignment to `TimedeltaIndex.values` here
+ pandas/tests/arithmetic/test_datetime64.py:2190:13 error[invalid-assignment] Cannot assign to read-only property `_values` on object of type `TimedeltaIndex`: Attempted assignment to `TimedeltaIndex._values` here

pandera (https://github.com/pandera-dev/pandera)
+ pandera/backends/polars/base.py:143:13 error[invalid-assignment] Invalid subscript assignment with key of type `Unknown | None` and value of type `int` on object of type `defaultdict[str, int]`

pip (https://github.com/pypa/pip)
- src/pip/_vendor/pygments/filters/__init__.py:833:12 error[unresolved-attribute] Object of type `Self@__init__` has no attribute `tabs`
- src/pip/_vendor/pygments/filters/__init__.py:834:13 error[unresolved-attribute] Object of type `Self@__init__` has no attribute `tabs`
- src/pip/_vendor/pygments/filters/__init__.py:835:12 error[unresolved-attribute] Object of type `Self@__init__` has no attribute `newlines`
- src/pip/_vendor/pygments/filters/__init__.py:836:13 error[unresolved-attribute] Object of type `Self@__init__` has no attribute `newlines`
- src/pip/_vendor/pygments/filters/__init__.py:842:20 error[unresolved-attribute] Object of type `Self@filter` has no attribute `tabs`
- src/pip/_vendor/pygments/filters/__init__.py:843:24 error[unresolved-attribute] Object of type `Self@filter` has no attribute `newlines`
- src/pip/_vendor/pygments/filters/__init__.py:859:51 error[unresolved-attribute] Object of type `Self@filter` has no attribute `tabs`
- src/pip/_vendor/pygments/filters/__init__.py:859:62 error[unresolved-attribute] Object of type `Self@filter` has no attribute `newlines`
+ src/pip/_vendor/urllib3/util/ssltransport.py:145:9 error[unresolved-attribute] Unresolved attribute `_io_refs` on type `socket`

prefect (https://github.com/PrefectHQ/prefect)
+ src/integrations/prefect-kubernetes/tests/test_worker.py:98:9 error[unresolved-attribute] Unresolved attribute `current_time` on type `def mock_sleep(duration: float) -> CoroutineType[Any, Any, Unknown]`

pwndbg (https://github.com/pwndbg/pwndbg)
+ pwndbg/commands/hexdump.py:170:9 error[unresolved-attribute] Unresolved attribute `offset` on type `CommandObj`
+ pwndbg/commands/hexdump.py:183:5 error[unresolved-attribute] Unresolved attribute `offset` on type `CommandObj`
+ pwndbg/commands/telescope.py:129:9 error[unresolved-attribute] Unresolved attribute `offset` on type `CommandObj`
+ pwndbg/commands/telescope.py:279:5 error[unresolved-attribute] Unresolved attribute `offset` on type `CommandObj`

pycryptodome (https://github.com/Legrandin/pycryptodome)
+ lib/Crypto/SelfTest/loader.py:100:13 error[invalid-assignment] Object of type `list[Unknown]` is not assignable to attribute `others` on type `None | TestVector`

pywin32 (https://github.com/mhammond/pywin32)
- pythonwin/pywin/scintilla/formatter.py:670:24 error[unresolved-attribute] Object of type `Self@RegisterStyle` has no attribute `nextstylenum`
- pythonwin/pywin/scintilla/formatter.py:671:13 error[unresolved-attribute] Object of type `Self@RegisterStyle` has no attribute `nextstylenum`

rotki (https://github.com/rotki/rotki)
+ rotkehlchen/chain/ethereum/modules/thegraph/accountant.py:31:9 error[invalid-assignment] Invalid subscript assignment with key of type `str | None` and value of type `FVal` on object of type `dict[ChecksumAddress, FVal]`

scikit-learn (https://github.com/scikit-learn/scikit-learn)
+ sklearn/decomposition/_lda.py:155:13 error[invalid-assignment] Cannot assign to a subscript on an object of type `None`
+ sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py:873:25 error[invalid-assignment] Cannot assign to a subscript on an object of type `None`
+ sklearn/preprocessing/_polynomial.py:1079:25 error[invalid-assignment] Invalid subscript assignment with key of type `tuple[slice[None, None, None], slice[None, Unknown | int, None]]` and value of type `lil_array[float64]` on object of type `lil_array[float64]`

scipy (https://github.com/scipy/scipy)
+ scipy/differentiate/tests/test_differentiate.py:99:13 error[unresolved-attribute] Unresolved attribute `nit` on type `def f(xs, js) -> Unknown`
+ scipy/differentiate/tests/test_differentiate.py:276:13 error[unresolved-attribute] Unresolved attribute `iter` on type `def callback(res) -> Unknown`
+ scipy/integrate/_ode.py:784:9 error[unresolved-attribute] Unresolved attribute `active_global_handle` on type `type[Self@acquire_new_handle]`.
+ scipy/integrate/tests/test_tanhsinh.py:282:13 error[unresolved-attribute] Unresolved attribute `ncall` on type `def f(x, p) -> Unknown`
+ scipy/integrate/tests/test_tanhsinh.py:283:13 error[unresolved-attribute] Unresolved attribute `feval` on type `def f(x, p) -> Unknown`
+ scipy/integrate/tests/test_tanhsinh.py:315:13 error[unresolved-attribute] Unresolved attribute `nit` on type `def f(xs, js) -> Unknown`
+ scipy/integrate/tests/test_tanhsinh.py:379:13 error[unresolved-attribute] Unresolved attribute `calls` on type `def f(x) -> Unknown`
+ scipy/integrate/tests/test_tanhsinh.py:380:13 error[unresolved-attribute] Unresolved attribute `feval` on type `def f(x) -> Unknown`
+ scipy/integrate/tests/test_tanhsinh.py:554:13 error[unresolved-attribute] Unresolved attribute `calls` on type `def f(x) -> Unknown`
+ scipy/integrate/tests/test_tanhsinh.py:555:13 error[unresolved-attribute] Unresolved attribute `feval` on type `def f(x) -> Unknown`
+ scipy/integrate/tests/test_tanhsinh.py:623:13 error[unresolved-attribute] Unresolved attribute `iter` on type `def callback(res) -> Unknown`
+ scipy/integrate/tests/test_tanhsinh.py:951:13 error[unresolved-attribute] Unresolved attribute `feval` on type `def f(x, p) -> Unknown`
+ scipy/integrate/tests/test_tanhsinh.py:997:13 error[unresolved-attribute] Unresolved attribute `nfev` on type `def f(x) -> Unknown`
- scipy/optimize/_hessian_update_strategy.py:214:29 error[unresolved-attribute] Attribute `dtype` is not defined on `None`, `int`, `float*` in union `None | ndarray[tuple[int, int], dtype[Any]] | float | ndarray[tuple[Any, ...], dtype[Any]]`
+ scipy/optimize/_hessian_update_strategy.py:214:29 error[unresolved-attribute] Attribute `dtype` is not defined on `None`, `int`, `float*` in union `None | ndarray[tuple[int, int], dtype[Any]] | float | ... omitted 3 union elements`
- scipy/optimize/_hessian_update_strategy.py:217:29 error[unresolved-attribute] Attribute `dtype` is not defined on `None`, `int`, `float*` in union `None | ndarray[tuple[int, int], dtype[Any]] | float | ndarray[tuple[Any, ...], dtype[Any]]`
+ scipy/optimize/_hessian_update_strategy.py:217:29 error[unresolved-attribute] Attribute `dtype` is not defined on `None`, `int`, `float*` in union `None | ndarray[tuple[int, int], dtype[Any]] | float | ... omitted 3 union elements`
- scipy/optimize/_hessian_update_strategy.py:239:21 error[unsupported-operator] Operator `*=` is not supported between objects of type `None` and `float* | ndarray[tuple[Any, ...], dtype[Any]]`
+ scipy/optimize/_hessian_update_strategy.py:239:21 error[unsupported-operator] Operator `*=` is not supported between objects of type `None` and `float* | ndarray[tuple[Any, ...], dtype[Unknown]]`
- scipy/optimize/_hessian_update_strategy.py:244:21 error[unsupported-operator] Operator `*=` is not supported between objects of type `None` and `float* | ndarray[tuple[Any, ...], dtype[Any]]`
+ scipy/optimize/_hessian_update_strategy.py:244:21 error[unsupported-operator] Operator `*=` is not supported between objects of type `None` and `float* | ndarray[tuple[Any, ...], dtype[Unknown]]`
+ scipy/optimize/_minpack_py.py:158:9 error[unresolved-attribute] Unresolved attribute `nfev` on type `def _wrapped_func(*fargs) -> Unknown`
+ scipy/optimize/_nonlin.py:1366:9 error[invalid-assignment] Cannot assign to a subscript on an object of type `None`
+ scipy/optimize/_root.py:215:9 error[unresolved-attribute] Unresolved attribute `nfev` on type `def _wrapped_fun(*fargs) -> Unknown`
+ scipy/optimize/_zeros_py.py:108:9 error[unresolved-attribute] Unresolved attribute `_function_calls` on type `def f_raise(x, *args) -> Unknown`
+ scipy/optimize/tests/test__differential_evolution.py:285:13 error[unresolved-attribute] Unresolved attribute `nit` on type `def callback(intermediate_result) -> Unknown`
+ scipy/optimize/tests/test__shgo.py:1106:13 error[unresolved-attribute] Unresolved attribute `nfev` on type `def fun(x) -> Unknown`
+ scipy/optimize/tests/test__shgo.py:1121:13 error[unresolved-attribute] Unresolved attribute `nfev` on type `def fun(x) -> Unknown`
+ scipy/optimize/tests/test__shgo.py:1133:13 error[unresolved-attribute] Unresolved attribute `nfev` on type `def fun(x) -> Unknown`
+ scipy/optimize/tests/test_bracket.py:66:13 error[unresolved-attribute] Unresolved attribute `count` on type `def f(x) -> Unknown`
+ scipy/optimize/tests/test_bracket.py:151:13 error[unresolved-attribute] Unresolved attribute `f_evals` on type `def f(...) -> Unknown`
+ scipy/optimize/tests/test_bracket.py:310:13 error[invalid-assignment] Object of type `Unknown` is not assignable to attribute `count` on type `(def f(x, c) -> Unknown) | (def f(x) -> Unknown)`
+ scipy/optimize/tests/test_bracket.py:397:13 error[unresolved-attribute] Unresolved attribute `count` on type `def f(x, a, b) -> Unknown`
+ scipy/optimize/tests/test_chandrupatla.py:225:13 error[unresolved-attribute] Unresolved attribute `f_evals` on type `def f(...) -> Unknown`
+ scipy/optimize/tests/test_chandrupatla.py:351:13 error[unresolved-attribute] Unresolved attribute `iter` on type `def callback(res) -> Unknown`
+ scipy/optimize/tests/test_chandrupatla.py:574:13 error[unresolved-attribute] Unresolved attribute `f_evals` on type `def f(...) -> Unknown`
+ scipy/optimize/tests/test_chandrupatla.py:749:13 error[unresolved-attribute] Unresolved attribute `iter` on type `def callback(res) -> Unknown`
+ scipy/optimize/tests/test_optimize.py:1682:13 error[unresolved-attribute] Unresolved attribute `i` on type `def callback() -> Unknown`
+ scipy/optimize/tests/test_zeros.py:856:9 error[unresolved-attribute] Unresolved attribute `_count` on type `def f(x) -> Unknown`
+ scipy/optimize/tests/test_zeros.py:877:9 error[unresolved-attribute] Unresolved attribute `calls` on type `def f(x) -> Unknown`
+ scipy/signal/_spectral_py.py:1284:9 error[invalid-assignment] Cannot assign to a subscript on an object of type `Literal[0]`
+ scipy/signal/_spectral_py.py:1412:9 error[invalid-assignment] Cannot assign to a subscript on an object of type `Literal[0]`
- scipy/special/_orthogonal.py:187:9 error[unresolved-attribute] Object of type `Self@_scale` has no attribute `_coeffs`
+ scipy/stats/tests/test_continued_fraction.py:145:13 error[unresolved-attribute] Unresolved attribute `nfev` on type `def a(n, x) -> Unknown`
+ scipy/stats/tests/test_continued_fraction.py:149:13 error[unresolved-attribute] Unresolved attribute `nfev` on type `def b(n, x) -> Unknown`
+ scipy/stats/tests/test_resampling.py:864:13 error[unresolved-attribute] Unresolved attribute `counter` on type `def statistic(x, axis) -> Unknown`
+ scipy/stats/tests/test_resampling.py:1211:13 error[unresolved-attribute] Unresolved attribute `counter` on type `def test(x, axis) -> Unknown`
+ scipy/stats/tests/test_resampling.py:1405:13 error[unresolved-attribute] Unresolved attribute `counter` on type `def statistic(x, y, axis) -> Unknown`

sockeye (https://github.com/awslabs/sockeye)
+ sockeye/data_io.py:522:13 error[invalid-assignment] Invalid subscript assignment with key of type `int | None` and value of type `int | Unknown` on object of type `list[int]`
+ sockeye/training.py:279:17 error[invalid-assignment] Object of type `int` is not assignable to attribute `epoch` on type `None | TrainState`
+ sockeye/training.py:316:9 error[invalid-assignment] Object of type `int` is not assignable to attribute `checkpoint` on type `None | TrainState`
+ sockeye/training.py:390:9 error[invalid-assignment] Object of type `int` is not assignable to attribute `batches` on type `None | TrainState`
+ sockeye/training.py:391:9 error[invalid-assignment] Object of type `int` is not assignable to attribute `samples` on type `None | TrainState`
+ sockeye/training.py:396:9 error[invalid-assignment] Object of type `int` is not assignable to attribute `updates` on type `None | TrainState`
+ sockeye/training.py:510:13 error[invalid-assignment] Object of type `int` is not assignable to attribute `num_not_improved` on type `None | TrainState`

spack (https://github.com/spack/spack)
- lib/spack/spack/vendor/macholib/MachO.py:411:13 error[unsupported-operator] Operator `+` is not supported between objects of type `None | Unknown` and `None | int`
+ lib/spack/spack/vendor/macholib/MachO.py:411:13 error[unsupported-operator] Operator `+` is not supported between objects of type `None | Unknown` and `None | int | Unknown`
- lib/spack/spack/vendor/macholib/MachO.py:419:21 error[unsupported-operator] Operator `+` is not supported between objects of type `None | Unknown` and `None | int`
+ lib/spack/spack/vendor/macholib/MachO.py:419:21 error[unsupported-operator] Operator `+` is not supported between objects of type `None | Unknown` and `None | int | Unknown`
+ lib/spack/spack/vendor/macholib/MachO.py:424:9 error[invalid-assignment] Object of type `Unknown` is not assignable to attribute `sizeofcmds` on type `None | Unknown`
- lib/spack/spack/vendor/pyrsistent/_pvector.py:35:9 error[unresolved-attribute] Unresolved attribute `_count` on type `Self@__new__`
- lib/spack/spack/vendor/pyrsistent/_pvector.py:41:29 error[unresolved-attribute] Object of type `Self@__new__` has no attribute `_count`
- lib/spack/spack/vendor/pyrsistent/_pvector.py:45:16 error[unresolved-attribute] Object of type `Self@__len__` has no attribute `_count`
- lib/spack/spack/vendor/pyrsistent/_pvector.py:59:22 error[unresolved-attribute] Object of type `Self@__getitem__` has no attribute `_count`
- lib/spack/spack/vendor/pyrsistent/_pvector.py:81:64 error[unresolved-attribute] Object of type `Self@__eq__` has no attribute `_count`
- lib/spack/spack/vendor/pyrsistent/_pvector.py:274:18 error[unresolved-attribute] Object of type `Self@set` has no attribute `_count`
- lib/spack/spack/vendor/pyrsistent/_pvector.py:276:21 error[unresolved-attribute] Object of type `Self@set` has no attribute `_count`
- lib/spack/spack/vendor/pyrsistent/_pvector.py:280:38 error[unresolved-attribute] Object of type `Self@set` has no attribute `_count`
- lib/spack/spack/vendor/pyrsistent/_pvector.py:282:34 error[unresolved-attribute] Object of type `Self@set` has no attribute `_count`
- lib/spack/spack/vendor/pyrsistent/_pvector.py:284:17 error[unresolved-attribute] Object of type `Self@set` has no attribute `_count`
- lib/spack/spack/vendor/pyrsistent/_pvector.py:317:13 error[unresolved-attribute] Object of type `Self@_create_new_root` has no attribute `_count`
- lib/spack/spack/vendor/pyrsistent/_pvector.py:329:34 error[unresolved-attribute] Object of type `Self@append` has no attribute `_count`
- lib/spack/spack/vendor/pyrsistent/_pvector.py:333:30 error[unresolved-attribute] Object of type `Self@append` has no attribute `_count`
- lib/spack/spack/vendor/pyrsistent/_pvector.py:350:9 error[unresolved-attribute] Object of type `Self@_mutating_fill_tail` has no attribute `_count`
- lib/spack/spack/vendor/pyrsistent/_pvector.py:361:29 error[unresolved-attribute] Object of type `Self@_mutating_extend` has no attribute `_count`
- lib/spack/spack/vendor/pyrsistent/_pvector.py:389:23 error[unresolved-attribute] Object of type `Self@_push_tail` has no attribute `_count`

spark (https://github.com/apache/spark)
+ python/pyspark/pandas/tests/computation/test_describe.py:61:9 error[unresolved-attribute] Unresolved attribute `A` on type `DataFrame`
+ python/pyspark/pandas/tests/computation/test_describe.py:105:9 error[unresolved-attribute] Unresolved attribute `A` on type `DataFrame`
+ python/pyspark/pandas/tests/computation/test_describe.py:131:9 error[unresolved-attribute] Unresolved attribute `A` on type `DataFrame`
+ python/pyspark/pandas/tests/series/test_string_ops_basic.py:59:9 error[invalid-assignment] Cannot assign to a subscript on an object of type `Index`
+ python/pyspark/pandas/tests/series/test_string_ops_basic.py:59:9 error[invalid-assignment] Cannot assign to a subscript on an object of type `Series[Unknown]`

static-frame (https://github.com/static-frame/static-frame)
- static_frame/core/type_blocks.py:4165:67 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- static_frame/core/type_blocks.py:4207:67 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- static_frame/core/type_blocks.py:4223:63 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive

stone (https://github.com/dropbox/stone)
- stone/frontend/lexer.py:69:34 error[unsupported-operator] Operator `>` is not supported between objects of type `None | int` and `Literal[0]`
+ stone/frontend/lexer.py:69:34 error[unsupported-operator] Operator `>` is not supported between objects of type `None | int | Unknown` and `Literal[0]`
- stone/frontend/lexer.py:78:46 error[unsupported-operator] Operator `*` is not supported between objects of type `list[Unknown]` and `None | int`
+ stone/frontend/lexer.py:78:46 error[unsupported-operator] Operator `*` is not supported between objects of type `list[Unknown]` and `None | int | Unknown`

sympy (https://github.com/sympy/sympy)
- sympy/functions/elementary/trigonometric.py:1216:20 error[unresolved-attribute] Object of type `float` has no attribute `subs`
+ sympy/functions/elementary/trigonometric.py:1216:20 error[unresolved-attribute] Attribute `subs` is not defined on `int`, `float*` in union `Any | float`
- sympy/functions/elementary/trigonometric.py:1605:20 error[unresolved-attribute] Object of type `float` has no attribute `subs`
+ sympy/functions/elementary/trigonometric.py:1605:20 error[unresolved-attribute] Attribute `subs` is not defined on `int`, `float*` in union `Any | float`
- sympy/geometry/polygon.py:1695:16 error[unresolved-attribute] Object of type `Self@rotation` has no attribute `_rot`
- sympy/geometry/polygon.py:1943:9 error[unresolved-attribute] Object of type `Self@spin` has no attribute `_rot`
- sympy/geometry/polygon.py:1965:9 error[unresolved-attribute] Object of type `Self@rotate` has no attribute `_rot`
- sympy/geometry/polygon.py:2048:15 error[unresolved-attribute] Object of type `Self@vertices` has no attribute `_rot`
- sympy/geometry/polygon.py:1533:53 error[unresolved-attribute] Object of type `Self@args` has no attribute `_rot`
+ sympy/logic/boolalg.py:3020:21 error[invalid-assignment] Cannot assign to a subscript on an object of type `int`
- sympy/matrices/repmatrix.py:743:24 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- sympy/matrices/repmatrix.py:747:24 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- sympy/physics/continuum_mechanics/column.py:565:23 error[unresolved-attribute] Object of type `int` has no attribute `subs`
+ sympy/physics/continuum_mechanics/column.py:565:23 error[unresolved-attribute] Attribute `subs` is not defined on `int` in union `int | Expr | Unknown`
+ sympy/printing/pretty/pretty.py:648:17 error[invalid-assignment] Object of type `Unknown` is not assignable to attribute `baseline` on type `str | prettyForm`

urllib3 (https://github.com/urllib3/urllib3)
+ src/urllib3/util/ssltransport.py:145:9 error[unresolved-attribute] Unresolved attribute `_io_refs` on type `socket`

Full report with detailed diff (timing results)

@charliermarsh
charliermarsh force-pushed the charlie/ty-2175-augmented-collection-inference branch from f70cb90 to c861a9c Compare August 6, 2026 13:55
@charliermarsh
charliermarsh force-pushed the charlie/ty-2175-augmented-collection-inference branch from c861a9c to e5946cc Compare August 6, 2026 14:13
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.

1 participant