[ty] Infer collection types from augmented subscript stores - #27546
Draft
charliermarsh wants to merge 7 commits into
Draft
[ty] Infer collection types from augmented subscript stores#27546charliermarsh wants to merge 7 commits into
charliermarsh wants to merge 7 commits into
Conversation
Typing conformance resultsNo changes detected ✅Current numbersThe 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. |
Memory usage reportSummary
Significant changesClick to expand detailed breakdownsphinx
prefect
trio
flake8
|
|
| 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`
charliermarsh
force-pushed
the
charlie/ty-2175-augmented-collection-inference
branch
from
August 6, 2026 13:55
f70cb90 to
c861a9c
Compare
charliermarsh
force-pushed
the
charlie/ty-2175-augmented-collection-inference
branch
from
August 6, 2026 14:13
c861a9c to
e5946cc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.