[ty] Infer lambda expressions with Callable type context#22633
[ty] Infer lambda expressions with Callable type context#22633ibraheemdev merged 3 commits intomainfrom
Callable type context#22633Conversation
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 86.59%. The percentage of expected errors that received a diagnostic held steady at 80.96%. The number of fully passing files held steady at 68/132. |
|
5581b57 to
5d17506
Compare
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
invalid-argument-type |
88 | 16 | 87 |
invalid-assignment |
6 | 0 | 68 |
invalid-await |
41 | 0 | 0 |
unresolved-attribute |
7 | 0 | 28 |
unsupported-operator |
9 | 0 | 2 |
no-matching-overload |
7 | 0 | 0 |
invalid-return-type |
3 | 0 | 2 |
type-assertion-failure |
0 | 5 | 0 |
unused-type-ignore-comment |
0 | 5 | 0 |
not-subscriptable |
4 | 0 | 0 |
index-out-of-bounds |
0 | 0 | 1 |
| Total | 165 | 26 | 188 |
Changes in flaky projects detected. Raw diff output excludes flaky projects; see the HTML report for details.
Showing a random sample of 193 of 332 changes. See the HTML report for the full diff.
Raw diff sample (193 of 332 changes)
Expression (https://github.com/cognitedata/Expression)
+ tests/test_result.py:315:46 error[invalid-argument-type] Argument to bound method `filter_with` is incorrect: Expected `(Any, /) -> Literal["original error"]`, found `(value: Any) -> str`
asynq (https://github.com/quora/asynq)
- asynq/tests/test_futures.py:25:5 error[unresolved-attribute] Object of type `Future[Unknown]` has no attribute `on_computed`
+ asynq/tests/test_futures.py:25:5 error[unresolved-attribute] Object of type `Future[int]` has no attribute `on_computed`
attrs (https://github.com/python-attrs/attrs)
+ tests/test_cmp.py:364:23 error[invalid-argument-type] Argument to function `cmp_using` is incorrect: Expected `((Any, Any, /) -> bool) | None`, found `(a: Any, b: Any) -> _NotImplementedType | (bool & Unknown)`
- tests/test_validators.py:468:52 error[invalid-argument-type] Argument to function `include` is incorrect: Expected `type | str | Attribute[Any]`, found `(val) -> Unknown`
+ tests/test_validators.py:468:52 error[invalid-argument-type] Argument to function `include` is incorrect: Expected `type | str | Attribute[Any]`, found `(val) -> Literal[True]`
bokeh (https://github.com/bokeh/bokeh)
- src/bokeh/models/annotations/geometry.py:298:47 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `BoxInteractionHandles | UndefinedType | IntrinsicType`, found `() -> Unknown`
+ src/bokeh/models/annotations/geometry.py:298:47 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `BoxInteractionHandles | UndefinedType | IntrinsicType`, found `() -> BoxInteractionHandles`
+ src/bokeh/models/layouts.py:587:18 error[invalid-argument-type] Argument to bound method `accepts` is incorrect: Expected `(Any, /) -> TabPanel`, found `(items: Any) -> list[TabPanel]`
- src/bokeh/models/renderers/graph_renderer.py:89:45 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Argument type `() -> Unknown` does not satisfy upper bound `Serializable` of type variable `S`
+ src/bokeh/models/renderers/graph_renderer.py:89:45 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Argument type `() -> GlyphRenderer[Unknown]` does not satisfy upper bound `Serializable` of type variable `S`
- src/bokeh/models/renderers/graph_renderer.py:89:45 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `GlyphRenderer[Unknown] | UndefinedType | IntrinsicType`, found `() -> Unknown`
+ src/bokeh/models/renderers/graph_renderer.py:89:45 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `GlyphRenderer[Unknown] | UndefinedType | IntrinsicType`, found `() -> GlyphRenderer[Unknown]`
- src/bokeh/models/tools.py:573:39 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `BoxAnnotation | UndefinedType | IntrinsicType`, found `() -> Unknown`
+ src/bokeh/models/tools.py:573:39 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `BoxAnnotation | UndefinedType | IntrinsicType`, found `() -> BoxAnnotation`
cloud-init (https://github.com/canonical/cloud-init)
+ cloudinit/cmd/main.py:999:34 error[unresolved-attribute] Attribute `export_logs` is not defined on `Handler` in union `UnspecializedTypeVar | Handler`
+ cloudinit/cmd/main.py:1000:9 error[unresolved-attribute] Attribute `clean_logs` is not defined on `Handler` in union `UnspecializedTypeVar | Handler`
- tests/unittests/sources/test_altcloud.py:181:9 error[invalid-assignment] Object of type `() -> Unknown` is not assignable to attribute `user_data_rhevm` of type `def user_data_rhevm(self) -> Unknown`
+ tests/unittests/sources/test_altcloud.py:181:9 error[invalid-assignment] Object of type `() -> Literal[False]` is not assignable to attribute `user_data_rhevm` of type `def user_data_rhevm(self) -> Unknown`
- tests/unittests/sources/test_altcloud.py:190:9 error[invalid-assignment] Object of type `() -> Unknown` is not assignable to attribute `user_data_vsphere` of type `def user_data_vsphere(self) -> Unknown`
+ tests/unittests/sources/test_altcloud.py:190:9 error[invalid-assignment] Object of type `() -> Literal[False]` is not assignable to attribute `user_data_vsphere` of type `def user_data_vsphere(self) -> Unknown`
- tests/unittests/sources/test_altcloud.py:225:9 error[invalid-assignment] Object of type `() -> Unknown` is not assignable to attribute `user_data_rhevm` of type `def user_data_rhevm(self) -> Unknown`
+ tests/unittests/sources/test_altcloud.py:225:9 error[invalid-assignment] Object of type `() -> Literal[True]` is not assignable to attribute `user_data_rhevm` of type `def user_data_rhevm(self) -> Unknown`
- tests/unittests/sources/test_altcloud.py:235:9 error[invalid-assignment] Object of type `() -> Unknown` is not assignable to attribute `user_data_vsphere` of type `def user_data_vsphere(self) -> Unknown`
+ tests/unittests/sources/test_altcloud.py:235:9 error[invalid-assignment] Object of type `() -> Literal[True]` is not assignable to attribute `user_data_vsphere` of type `def user_data_vsphere(self) -> Unknown`
- tests/unittests/sources/test_exoscale.py:150:9 error[invalid-assignment] Object of type `() -> Unknown` is not assignable to attribute `ds_detect` of type `def ds_detect() -> Unknown`
+ tests/unittests/sources/test_exoscale.py:150:9 error[invalid-assignment] Object of type `() -> Literal[True]` is not assignable to attribute `ds_detect` of type `def ds_detect() -> Unknown`
- tests/unittests/sources/test_exoscale.py:216:9 error[invalid-assignment] Object of type `() -> Unknown` is not assignable to attribute `ds_detect` of type `def ds_detect() -> Unknown`
+ tests/unittests/sources/test_exoscale.py:216:9 error[invalid-assignment] Object of type `() -> Literal[False]` is not assignable to attribute `ds_detect` of type `def ds_detect() -> Unknown`
core (https://github.com/home-assistant/core)
+ homeassistant/components/zabbix/__init__.py:107:13 error[invalid-argument-type] Argument is incorrect: Expected `HassJob[(datetime, /), Coroutine[Any, Any, None] | None] | ((datetime, /) -> Coroutine[Any, Any, None] | None)`, found `(_: datetime) -> bool`
cryptography (https://github.com/pyca/cryptography)
+ tests/hazmat/primitives/test_dsa.py:940:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `Encoding`, found `Literal["notencoding"]`
+ tests/hazmat/primitives/test_dsa.py:940:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `Encoding`, found `Literal["notencoding"]`
+ tests/hazmat/primitives/test_dsa.py:940:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `Encoding`, found `Literal["notencoding"]`
+ tests/hazmat/primitives/test_dsa.py:940:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `Encoding`, found `Literal["notencoding"]`
+ tests/hazmat/primitives/test_dsa.py:940:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `Encoding`, found `Literal["notencoding"]`
+ tests/hazmat/primitives/test_dsa.py:955:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `PrivateFormat`, found `Literal["invalidformat"]`
+ tests/hazmat/primitives/test_dsa.py:955:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `PrivateFormat`, found `Literal["invalidformat"]`
+ tests/hazmat/primitives/test_dsa.py:955:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `PrivateFormat`, found `Literal["invalidformat"]`
+ tests/hazmat/primitives/test_dsa.py:955:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `PrivateFormat`, found `Literal["invalidformat"]`
+ tests/hazmat/primitives/test_dsa.py:970:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `KeySerializationEncryption`, found `Literal["notanencalg"]`
+ tests/hazmat/primitives/test_dsa.py:970:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `KeySerializationEncryption`, found `Literal["notanencalg"]`
+ tests/hazmat/primitives/test_dsa.py:970:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `KeySerializationEncryption`, found `Literal["notanencalg"]`
+ tests/hazmat/primitives/test_dsa.py:970:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `KeySerializationEncryption`, found `Literal["notanencalg"]`
+ tests/hazmat/primitives/test_dsa.py:970:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `KeySerializationEncryption`, found `Literal["notanencalg"]`
+ tests/hazmat/primitives/test_dsa.py:970:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `KeySerializationEncryption`, found `Literal["notanencalg"]`
+ tests/hazmat/primitives/test_dsa.py:970:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `KeySerializationEncryption`, found `Literal["notanencalg"]`
+ tests/hazmat/primitives/test_ec.py:1027:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `Encoding`, found `Literal["notencoding"]`
+ tests/hazmat/primitives/test_ec.py:1027:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `Encoding`, found `Literal["notencoding"]`
+ tests/hazmat/primitives/test_ec.py:1027:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `Encoding`, found `Literal["notencoding"]`
+ tests/hazmat/primitives/test_ec.py:1027:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `Encoding`, found `Literal["notencoding"]`
+ tests/hazmat/primitives/test_ec.py:1027:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `Encoding`, found `Literal["notencoding"]`
+ tests/hazmat/primitives/test_ec.py:1027:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `Encoding`, found `Literal["notencoding"]`
+ tests/hazmat/primitives/test_ec.py:1027:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `Encoding`, found `Literal["notencoding"]`
+ tests/hazmat/primitives/test_ec.py:1043:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `PrivateFormat`, found `Literal["invalidformat"]`
+ tests/hazmat/primitives/test_ec.py:1043:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `PrivateFormat`, found `Literal["invalidformat"]`
+ tests/hazmat/primitives/test_ec.py:1043:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `PrivateFormat`, found `Literal["invalidformat"]`
+ tests/hazmat/primitives/test_ec.py:1043:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `PrivateFormat`, found `Literal["invalidformat"]`
+ tests/hazmat/primitives/test_ec.py:1059:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `KeySerializationEncryption`, found `Literal["notanencalg"]`
+ tests/hazmat/primitives/test_ec.py:1059:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `KeySerializationEncryption`, found `Literal["notanencalg"]`
+ tests/hazmat/primitives/test_ec.py:1059:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `KeySerializationEncryption`, found `Literal["notanencalg"]`
+ tests/hazmat/primitives/test_ec.py:1059:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `KeySerializationEncryption`, found `Literal["notanencalg"]`
+ tests/hazmat/primitives/test_ec.py:1059:17 error[invalid-argument-type] Argument to bound method `private_bytes` is incorrect: Expected `KeySerializationEncryption`, found `Literal["notanencalg"]`
+ tests/hazmat/primitives/test_ec.py:1333:17 error[invalid-argument-type] Argument to bound method `public_bytes` is incorrect: Expected `Encoding`, found `Literal["notencoding"]`
+ tests/hazmat/primitives/test_ec.py:1333:17 error[invalid-argument-type] Argument to bound method `public_bytes` is incorrect: Expected `Encoding`, found `Literal["notencoding"]`
+ tests/hazmat/primitives/test_ec.py:1333:17 error[invalid-argument-type] Argument to bound method `public_bytes` is incorrect: Expected `Encoding`, found `Literal["notencoding"]`
+ tests/hazmat/primitives/test_ec.py:1333:17 error[invalid-argument-type] Argument to bound method `public_bytes` is incorrect: Expected `Encoding`, found `Literal["notencoding"]`
+ tests/hazmat/primitives/test_ec.py:1333:17 error[invalid-argument-type] Argument to bound method `public_bytes` is incorrect: Expected `Encoding`, found `Literal["notencoding"]`
+ tests/hazmat/primitives/test_ec.py:1333:17 error[invalid-argument-type] Argument to bound method `public_bytes` is incorrect: Expected `Encoding`, found `Literal["notencoding"]`
+ tests/hazmat/primitives/test_ec.py:1381:17 error[invalid-argument-type] Argument to bound method `public_bytes` is incorrect: Expected `PublicFormat`, found `Literal["invalidformat"]`
+ tests/hazmat/primitives/test_ec.py:1381:17 error[invalid-argument-type] Argument to bound method `public_bytes` is incorrect: Expected `PublicFormat`, found `Literal["invalidformat"]`
+ tests/hazmat/primitives/test_ec.py:1381:17 error[invalid-argument-type] Argument to bound method `public_bytes` is incorrect: Expected `PublicFormat`, found `Literal["invalidformat"]`
dd-trace-py (https://github.com/DataDog/dd-trace-py)
- ddtrace/debugging/_debugger.py:283:13 error[invalid-argument-type] Argument is incorrect: Expected `int | float`, found `Unknown | DerivedVariable[int | float | Unknown]`
+ ddtrace/debugging/_debugger.py:283:13 error[invalid-argument-type] Argument is incorrect: Expected `int | float`, found `Unknown | DerivedVariable[int | float]`
- ddtrace/debugging/_probe/status.py:34:35 error[invalid-argument-type] Argument to function `connector` is incorrect: Expected `str`, found `Unknown | DerivedVariable[str | Unknown]`
+ ddtrace/debugging/_probe/status.py:34:35 error[invalid-argument-type] Argument to function `connector` is incorrect: Expected `str`, found `Unknown | DerivedVariable[str | Unknown | DerivedVariable[str]]`
- ddtrace/debugging/_redaction.py:123:12 error[unresolved-attribute] Attribute `search` is not defined on `DerivedVariable[Unknown]` in union `(Unknown & ~None) | DerivedVariable[Unknown]`
+ ddtrace/debugging/_redaction.py:123:12 error[unresolved-attribute] Attribute `search` is not defined on `DerivedVariable[Pattern[str] | None]` in union `(Unknown & ~None) | DerivedVariable[Pattern[str] | None]`
- ddtrace/debugging/_signal/utils.py:223:38 error[unresolved-attribute] Attribute `__name__` is not defined on `(Any, /) -> bool` in union `((Any, /) -> bool) | ((_) -> Unknown)`
+ ddtrace/debugging/_signal/utils.py:223:38 error[unresolved-attribute] Object of type `(Any, /) -> bool` has no attribute `__name__`
- ddtrace/debugging/_signal/utils.py:253:38 error[unresolved-attribute] Attribute `__name__` is not defined on `(Any, /) -> bool` in union `((Any, /) -> bool) | ((_) -> Unknown)`
+ ddtrace/debugging/_signal/utils.py:253:38 error[unresolved-attribute] Object of type `(Any, /) -> bool` has no attribute `__name__`
- ddtrace/debugging/_signal/utils.py:309:41 error[unresolved-attribute] Attribute `__name__` is not defined on `(Any, /) -> bool` in union `((Any, /) -> bool) | ((_) -> Unknown)`
+ ddtrace/debugging/_signal/utils.py:309:41 error[unresolved-attribute] Object of type `(Any, /) -> bool` has no attribute `__name__`
- ddtrace/debugging/_signal/utils.py:328:34 error[unresolved-attribute] Attribute `__name__` is not defined on `(Any, /) -> bool` in union `((Any, /) -> bool) | ((_) -> Unknown)`
+ ddtrace/debugging/_signal/utils.py:328:34 error[unresolved-attribute] Object of type `(Any, /) -> bool` has no attribute `__name__`
- ddtrace/debugging/_signal/utils.py:354:37 error[unresolved-attribute] Attribute `__name__` is not defined on `(Any, /) -> bool` in union `((Any, /) -> bool) | ((_) -> Unknown)`
+ ddtrace/debugging/_signal/utils.py:354:37 error[unresolved-attribute] Object of type `(Any, /) -> bool` has no attribute `__name__`
- ddtrace/debugging/_uploader.py:94:35 error[invalid-argument-type] Argument to function `connector` is incorrect: Expected `str`, found `Unknown | DerivedVariable[str | Unknown]`
+ ddtrace/debugging/_uploader.py:94:35 error[invalid-argument-type] Argument to function `connector` is incorrect: Expected `str`, found `Unknown | DerivedVariable[str | Unknown | DerivedVariable[str]]`
- ddtrace/internal/symbol_db/symbols.py:604:36 error[unresolved-attribute] Attribute `match` is not defined on `DerivedVariable[Pattern[Unknown] | Unknown]` in union `Unknown | DerivedVariable[Pattern[Unknown] | Unknown]`
+ ddtrace/internal/symbol_db/symbols.py:604:36 error[unresolved-attribute] Attribute `match` is not defined on `DerivedVariable[Pattern[Unknown] | Pattern[str]]` in union `Unknown | DerivedVariable[Pattern[Unknown] | Pattern[str]]`
- tests/ci_visibility/test_atr.py:74:9 error[invalid-assignment] Object of type `() -> Unknown` is not assignable to attribute `efd_is_faulty_session` of type `def efd_is_faulty_session(self) -> Unknown`
+ tests/ci_visibility/test_atr.py:74:9 error[invalid-assignment] Object of type `() -> Literal[False]` is not assignable to attribute `efd_is_faulty_session` of type `def efd_is_faulty_session(self) -> Unknown`
- tests/ci_visibility/test_atr.py:169:9 error[invalid-assignment] Object of type `() -> Unknown` is not assignable to attribute `efd_is_faulty_session` of type `def efd_is_faulty_session(self) -> Unknown`
+ tests/ci_visibility/test_atr.py:169:9 error[invalid-assignment] Object of type `() -> Literal[False]` is not assignable to attribute `efd_is_faulty_session` of type `def efd_is_faulty_session(self) -> Unknown`
- tests/ci_visibility/test_atr.py:175:9 error[invalid-assignment] Object of type `() -> Unknown` is not assignable to attribute `get_session` of type `def get_session(self) -> TestVisibilitySession | None`
+ tests/ci_visibility/test_atr.py:175:9 error[invalid-assignment] Object of type `() -> TestVisibilitySession` is not assignable to attribute `get_session` of type `def get_session(self) -> TestVisibilitySession | None`
- tests/debugging/exploration/debugger.py:32:5 error[invalid-assignment] Object of type `(f) -> Unknown` is not assignable to attribute `capture_stack` of type `def capture_stack(top_frame: FrameType, max_height: int = 4096) -> list[dict[Unknown, Unknown]]`
+ tests/debugging/exploration/debugger.py:32:5 error[invalid-assignment] Object of type `(f) -> list[dict[str, int]]` is not assignable to attribute `capture_stack` of type `def capture_stack(top_frame: FrameType, max_height: int = 4096) -> list[dict[Unknown, Unknown]]`
- tests/internal/symbol_db/test_config.py:12:12 error[unresolved-attribute] Attribute `match` is not defined on `DerivedVariable[Pattern[Unknown] | Unknown]` in union `Unknown | DerivedVariable[Pattern[Unknown] | Unknown]`
+ tests/internal/symbol_db/test_config.py:12:12 error[unresolved-attribute] Attribute `match` is not defined on `DerivedVariable[Pattern[Unknown] | Pattern[str]]` in union `Unknown | DerivedVariable[Pattern[Unknown] | Pattern[str]]`
- tests/internal/symbol_db/test_config.py:13:12 error[unresolved-attribute] Attribute `match` is not defined on `DerivedVariable[Pattern[Unknown] | Unknown]` in union `Unknown | DerivedVariable[Pattern[Unknown] | Unknown]`
+ tests/internal/symbol_db/test_config.py:13:12 error[unresolved-attribute] Attribute `match` is not defined on `DerivedVariable[Pattern[Unknown] | Pattern[str]]` in union `Unknown | DerivedVariable[Pattern[Unknown] | Pattern[str]]`
- tests/internal/symbol_db/test_config.py:14:12 error[unresolved-attribute] Attribute `match` is not defined on `DerivedVariable[Pattern[Unknown] | Unknown]` in union `Unknown | DerivedVariable[Pattern[Unknown] | Unknown]`
+ tests/internal/symbol_db/test_config.py:14:12 error[unresolved-attribute] Attribute `match` is not defined on `DerivedVariable[Pattern[Unknown] | Pattern[str]]` in union `Unknown | DerivedVariable[Pattern[Unknown] | Pattern[str]]`
discord.py (https://github.com/Rapptz/discord.py)
- discord/enums.py:98:5 error[invalid-assignment] Object of type `(self) -> Unknown` is not assignable to attribute `__str__` of type `def __str__(self) -> str`
+ discord/enums.py:98:5 error[invalid-assignment] Object of type `(self) -> str` is not assignable to attribute `__str__` of type `def __str__(self) -> str`
- discord/enums.py:100:9 error[invalid-assignment] Object of type `(self, other) -> Unknown` is not assignable to attribute `__le__` of type `def __le__(self, value: tuple[Unknown, ...], /) -> bool`
+ discord/enums.py:100:9 error[invalid-assignment] Object of type `(self, other) -> Literal[False] | Unknown` is not assignable to attribute `__le__` of type `def __le__(self, value: tuple[Unknown, ...], /) -> bool`
- discord/enums.py:101:9 error[invalid-assignment] Object of type `(self, other) -> Unknown` is not assignable to attribute `__ge__` of type `def __ge__(self, value: tuple[Unknown, ...], /) -> bool`
+ discord/enums.py:101:9 error[invalid-assignment] Object of type `(self, other) -> Literal[False] | Unknown` is not assignable to attribute `__ge__` of type `def __ge__(self, value: tuple[Unknown, ...], /) -> bool`
- discord/enums.py:102:9 error[invalid-assignment] Object of type `(self, other) -> Unknown` is not assignable to attribute `__lt__` of type `def __lt__(self, value: tuple[Unknown, ...], /) -> bool`
+ discord/enums.py:102:9 error[invalid-assignment] Object of type `(self, other) -> Literal[False] | Unknown` is not assignable to attribute `__lt__` of type `def __lt__(self, value: tuple[Unknown, ...], /) -> bool`
- discord/enums.py:103:9 error[invalid-assignment] Object of type `(self, other) -> Unknown` is not assignable to attribute `__gt__` of type `def __gt__(self, value: tuple[Unknown, ...], /) -> bool`
+ discord/enums.py:103:9 error[invalid-assignment] Object of type `(self, other) -> Literal[False] | Unknown` is not assignable to attribute `__gt__` of type `def __gt__(self, value: tuple[Unknown, ...], /) -> bool`
- discord/file.py:106:9 error[invalid-assignment] Object of type `() -> Unknown` is not assignable to attribute `close` of type `def close(self) -> None`
+ discord/file.py:106:9 error[invalid-assignment] Object of type `() -> None` is not assignable to attribute `close` of type `def close(self) -> None`
egglog-python (https://github.com/egraphs-good/egglog-python)
+ python/egglog/exp/array_api.py:2031:71 error[invalid-argument-type] Argument to bound method `if_` is incorrect: Expected `() -> NDArray`, found `() -> Value | Unknown | Int`
httpx-caching (https://github.com/johtso/httpx-caching)
+ httpx_caching/_utils.py:47:19 error[invalid-await] `Unknown | None` is not awaitable
hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
+ src/hydra_zen/wrapper/_implementations.py:1735:52 error[invalid-assignment] Object of type `((x: str | None) -> object) | (((str | None, /) -> str | None) & ~Top[Mapping[Unknown, object]])` is not assignable to `(str | None, /) -> str | None`
ibis (https://github.com/ibis-project/ibis)
- ibis/common/tests/test_annotations.py:84:27 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Pattern`, found `(x, *_, **__) -> Unknown`
+ ibis/common/tests/test_annotations.py:84:27 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Pattern`, found `(x, *_, **__) -> int`
- ibis/common/tests/test_annotations.py:125:24 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Pattern`, found `(x, *_, **__) -> Unknown`
+ ibis/common/tests/test_annotations.py:125:24 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Pattern`, found `(x, *_, **__) -> str`
ignite (https://github.com/pytorch/ignite)
+ tests/ignite/handlers/test_checkpoint.py:102:53 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `((Engine, /) -> int | float) | None`, found `(e: Engine) -> dict[str, int]`
jax (https://github.com/google/jax)
- jax/_src/ad_checkpoint.py:801:16 error[unresolved-attribute] Unresolved attribute `in_cts_zero` on type `() -> Unknown`
+ jax/_src/ad_checkpoint.py:801:16 error[unresolved-attribute] Unresolved attribute `in_cts_zero` on type `() -> None`
- jax/_src/ad_checkpoint.py:810:28 error[unresolved-attribute] Object of type `() -> Unknown` has no attribute `in_cts_zero`
+ jax/_src/ad_checkpoint.py:810:28 error[unresolved-attribute] Object of type `() -> None` has no attribute `in_cts_zero`
- jax/_src/hijax.py:508:7 error[unresolved-attribute] Unresolved attribute `out_nzs` on type `() -> Unknown`
+ jax/_src/hijax.py:508:7 error[unresolved-attribute] Unresolved attribute `out_nzs` on type `() -> None`
- jax/_src/hijax.py:611:1 error[invalid-assignment] Object of type `(*args, *, _prim, **_) -> Unknown` is not assignable to attribute `is_high` of type `def is_high(self, *avals, **params) -> bool`
+ jax/_src/hijax.py:611:1 error[invalid-assignment] Object of type `(*args, *, _prim, **_) -> Literal[True]` is not assignable to attribute `is_high` of type `def is_high(self, *avals, **params) -> bool`
- jax/_src/pallas/mosaic_gpu/lowering.py:3667:22 error[invalid-argument-type] Argument to function `safe_map` is incorrect: Expected `(Any, dtype[Any] | Unknown | ShapedAbstractValue, /) -> Unknown`, found `(def _ensure_ir_value(x: Any, dtype: dtype[Any]) -> Unknown) | ((v, aval) -> Unknown)`
+ jax/_src/pallas/mosaic_gpu/lowering.py:3667:22 error[invalid-argument-type] Argument to function `safe_map` is incorrect: Expected `(Any, dtype[Any] | Unknown | ShapedAbstractValue, /) -> Unknown | FragmentedArray`, found `(def _ensure_ir_value(x: Any, dtype: dtype[Any]) -> Unknown) | ((v, aval) -> Unknown | FragmentedArray)`
+ jax/_src/pallas/pipelining/schedulers.py:123:7 error[invalid-assignment] Invalid subscript assignment with key of type `int | str` and value of type `int` on object of type `defaultdict[Unknown, None]`
+ jax/_src/pallas/pipelining/schedulers.py:159:16 error[invalid-argument-type] Argument is incorrect: Expected `Mapping[int | str, int]`, found `defaultdict[Unknown, None]`
- jax/_src/test_loader.py:157:9 error[invalid-assignment] Object of type `() -> Unknown` is not assignable to attribute `time_getter` on type `Unknown | TestResult`
+ jax/_src/test_loader.py:157:9 error[invalid-assignment] Object of type `() -> int | float` is not assignable to attribute `time_getter` on type `Unknown | TestResult`
+ jax/experimental/jet.py:469:16 error[unsupported-operator] Operator `*` is not supported between objects of type `int` and `None | Unknown | Array`
+ jax/experimental/jet.py:484:14 error[unsupported-operator] Operator `*` is not supported between objects of type `int` and `None | Unknown | Array`
jinja (https://github.com/pallets/jinja)
- tests/test_ext.py:291:9 error[invalid-assignment] Invalid subscript assignment with key of type `Literal["gettext"]` and value of type `(x) -> Unknown` on object of type `dict[str, <class 'range'> | <class 'dict'> | ((n: int = 5, html: bool = True, min: int = 20, max: int = 100) -> str) | ... omitted 3 union elements]`
+ tests/test_ext.py:291:9 error[invalid-assignment] Invalid subscript assignment with key of type `Literal["gettext"]` and value of type `(x: int) -> Unknown` on object of type `dict[str, <class 'range'> | <class 'dict'> | ((n: int = 5, html: bool = True, min: int = 20, max: int = 100) -> str) | ... omitted 3 union elements]`
- tests/test_regression.py:354:9 error[invalid-assignment] Invalid subscript assignment with key of type `Literal["get_int"]` and value of type `() -> Unknown` on object of type `dict[str, <class 'range'> | <class 'dict'> | ((n: int = 5, html: bool = True, min: int = 20, max: int = 100) -> str) | ... omitted 3 union elements]`
+ tests/test_regression.py:354:9 error[invalid-assignment] Invalid subscript assignment with key of type `Literal["get_int"]` and value of type `() -> Literal[42]` on object of type `dict[str, <class 'range'> | <class 'dict'> | ((n: int = 5, html: bool = True, min: int = 20, max: int = 100) -> str) | ... omitted 3 union elements]`
materialize (https://github.com/MaterializeInc/materialize)
- misc/python/materialize/cli/scratch/__main__.py:99:19 error[index-out-of-bounds] Index 4 is out of bounds for tuple `tuple[str, (p) -> Unknown, () -> Unknown, str]` with length 4
+ misc/python/materialize/cli/scratch/__main__.py:99:19 error[index-out-of-bounds] Index 4 is out of bounds for tuple `tuple[str, (p) -> Unknown, () -> None, str]` with length 4
meson (https://github.com/mesonbuild/meson)
- mesonbuild/backend/ninjabackend.py:1943:34 error[invalid-assignment] Object of type `str | Unknown` is not assignable to `Literal["2015", "2018", "2021"]`
+ mesonbuild/backend/ninjabackend.py:1943:34 error[invalid-assignment] Object of type `str` is not assignable to `Literal["2015", "2018", "2021"]`
- unittests/internaltests.py:279:9 error[invalid-assignment] Object of type `() -> Unknown` is not assignable to attribute `get_default_include_dirs` of type `def get_default_include_dirs(self) -> list[str]`
+ unittests/internaltests.py:279:9 error[invalid-assignment] Object of type `() -> list[str]` is not assignable to attribute `get_default_include_dirs` of type `def get_default_include_dirs(self) -> list[str]`
+ unittests/machinefiletests.py:186:26 error[unresolved-attribute] Attribute `id` is not defined on `None` in union `Compiler | None`
mitmproxy (https://github.com/mitmproxy/mitmproxy)
- mitmproxy/tools/console/commands.py:109:38 error[invalid-argument-type] Argument to bound method `connect` is incorrect: Expected `(text) -> None`, found `bound method Self@__init__.sig_mod(txt) -> Unknown`
+ mitmproxy/tools/console/commands.py:109:38 error[invalid-argument-type] Argument to bound method `connect` is incorrect: Expected `(text: UnspecializedTypeVar) -> None`, found `bound method Self@__init__.sig_mod(txt) -> Unknown`
openlibrary (https://github.com/internetarchive/openlibrary)
- openlibrary/book_providers.py:864:9 error[invalid-argument-type] Argument to function `multisort_best` is incorrect: Expected `list[tuple[Literal["min", "max"], (tuple[Edition, AbstractBookProvider[Unknown] | None] | Unknown, /) -> int | float]]`, found `list[tuple[str, (rec) -> Unknown]]`
+ openlibrary/book_providers.py:864:9 error[invalid-argument-type] Argument to function `multisort_best` is incorrect: Expected `list[tuple[Literal["min", "max"], (tuple[Edition, AbstractBookProvider[Unknown] | None] | Unknown, /) -> int | float]]`, found `list[tuple[str, (rec) -> int | float]]`
paasta (https://github.com/yelp/paasta)
- paasta_tools/setup_prometheus_adapter_config.py:983:12 error[invalid-return-type] Return type does not match returned value: expected `PrometheusAdapterConfig`, found `dict[str, list[PrometheusAdapterRule | Unknown]]`
+ paasta_tools/setup_prometheus_adapter_config.py:983:12 error[invalid-return-type] Return type does not match returned value: expected `PrometheusAdapterConfig`, found `dict[str, list[PrometheusAdapterRule | UnspecializedTypeVar]]`
pandas (https://github.com/pandas-dev/pandas)
- pandas/io/pytables.py:2290:23 error[invalid-assignment] Object of type `(x, **kwds) -> Unknown` is not assignable to `type[Index]`
+ pandas/io/pytables.py:2290:23 error[invalid-assignment] Object of type `(x, **kwds) -> PeriodIndex` is not assignable to `type[Index]`
- pandas/tests/io/formats/test_to_latex.py:953:30 error[invalid-argument-type] Argument to bound method `to_latex` is incorrect: Expected `list[(...) -> Unknown] | tuple[(...) -> Unknown, ...] | Mapping[str | int, (...) -> Unknown] | None`, found `dict[str, (x) -> Unknown]`
+ pandas/tests/io/formats/test_to_latex.py:953:30 error[invalid-argument-type] Argument to bound method `to_latex` is incorrect: Expected `list[(...) -> Unknown] | tuple[(...) -> Unknown, ...] | Mapping[str | int, (...) -> Unknown] | None`, found `dict[str, ((x) -> Unknown) | ((x) -> str)]`
- pandas/tests/io/test_gcs.py:36:5 error[invalid-assignment] Object of type `() -> Unknown` is not assignable to attribute `close` of type `def close(self) -> None`
+ pandas/tests/io/test_gcs.py:36:5 error[invalid-assignment] Object of type `() -> Literal[True]` is not assignable to attribute `close` of type `def close(self) -> None`
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- tests/series/test_series.py:812:9 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[Any]`
- tests/series/test_series.py:2220:9 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[Any]`
- tests/series/test_series.py:2276:9 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[Any]`
- tests/series/test_series.py:2823:9 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[BaseOffset]`
- tests/test_pandas.py:257:9 error[type-assertion-failure] Type `Unknown` does not match asserted type `DataFrame`
poetry (https://github.com/python-poetry/poetry)
- src/poetry/repositories/installed_repository.py:268:33 error[unresolved-attribute] Attribute `_path` is not defined on `Distribution` in union `Distribution | Unknown`
+ src/poetry/repositories/installed_repository.py:268:33 error[unresolved-attribute] Attribute `_path` is not defined on `Distribution` in union `Distribution | UnspecializedTypeVar`
- tests/puzzle/test_provider.py:988:5 error[invalid-assignment] Object of type `(name, version) -> Unknown` is not assignable to attribute `_get_release_info` of type `def _get_release_info(self, name: NormalizedName, version: Unknown) -> dict[str, Any]`
+ tests/puzzle/test_provider.py:988:5 error[invalid-assignment] Object of type `(name, version) -> dict[str, Any]` is not assignable to attribute `_get_release_info` of type `def _get_release_info(self, name: NormalizedName, version: Unknown) -> dict[str, Any]`
- tests/repositories/test_cached_repository.py:67:5 error[invalid-assignment] Object of type `(name, version) -> Unknown` is not assignable to attribute `_get_release_info` of type `def _get_release_info(self, name: NormalizedName, version: Unknown) -> dict[str, Any]`
+ tests/repositories/test_cached_repository.py:67:5 error[invalid-assignment] Object of type `(name, version) -> dict[str, Any]` is not assignable to attribute `_get_release_info` of type `def _get_release_info(self, name: NormalizedName, version: Unknown) -> dict[str, Any]`
pwndbg (https://github.com/pwndbg/pwndbg)
+ pwndbg/aglib/disasm/disassembly.py:102:60 error[invalid-assignment] Object of type `defaultdict[int, int | None]` is not assignable to `defaultdict[int, int]`
+ pwndbg/aglib/heap/ptmalloc.py:1427:28 error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- pwndbg/aglib/onegadget.py:233:49 error[invalid-argument-type] Argument to function `generateColorFunction` is incorrect: Expected `dict[str, (str, /) -> str]`, found `dict[str, (x) -> Unknown]`
+ pwndbg/aglib/onegadget.py:233:49 error[invalid-argument-type] Argument to function `generateColorFunction` is incorrect: Expected `dict[str, (str, /) -> str]`, found `dict[str, (x) -> str]`
- pwndbg/gdblib/tui/context.py:221:24 error[invalid-assignment] Object of type `(...) -> Unknown` is not assignable to `def _ansi_substr(self, line: str, start_char: int, end_char: int) -> str`
+ pwndbg/gdblib/tui/context.py:221:24 error[invalid-assignment] Object of type `(...) -> Unknown | str` is not assignable to `def _ansi_substr(self, line: str, start_char: int, end_char: int) -> str`
pyodide (https://github.com/pyodide/pyodide)
- src/py/_pyodide/_base.py:312:9 error[invalid-assignment] Invalid subscript assignment with key of type `str` and value of type `list[() -> Unknown]` on object of type `dict[str, tuple[() -> str | None] | tuple[int, int | float | None, list[str], str]]`
+ src/py/_pyodide/_base.py:312:9 error[invalid-assignment] Invalid subscript assignment with key of type `str` and value of type `list[() -> Unknown | str]` on object of type `dict[str, tuple[() -> str | None] | tuple[int, int | float | None, list[str], str]]`
pytest (https://github.com/pytest-dev/pytest)
- src/_pytest/junitxml.py:258:9 error[invalid-assignment] Object of type `() -> Unknown` is not assignable to attribute `to_xml` of type `def to_xml(self) -> Element[Unknown]`
+ src/_pytest/junitxml.py:258:9 error[invalid-assignment] Object of type `() -> Element[Unknown]` is not assignable to attribute `to_xml` of type `def to_xml(self) -> Element[Unknown]`
rotki (https://github.com/rotki/rotki)
- rotkehlchen/chain/evm/decoding/velodrome/decoder.py:561:17 error[invalid-assignment] Invalid subscript assignment with key of type `ChecksumAddress` and value of type `tuple[(context) -> Unknown]` on object of type `dict[Unknown | ChecksumAddress, tuple[bound method Self@addresses_to_decoders._decode_voting_escrow_events(context: DecoderContext) -> EvmDecodingOutput] | tuple[bound method Self@addresses_to_decoders._decode_vote_events(context: DecoderContext) -> EvmDecodingOutput]]`
+ rotkehlchen/chain/evm/decoding/velodrome/decoder.py:561:17 error[invalid-assignment] Invalid subscript assignment with key of type `ChecksumAddress` and value of type `tuple[(context) -> EvmDecodingOutput]` on object of type `dict[Unknown | ChecksumAddress, tuple[bound method Self@addresses_to_decoders._decode_voting_escrow_events(context: DecoderContext) -> EvmDecodingOutput] | tuple[bound method Self@addresses_to_decoders._decode_vote_events(context: DecoderContext) -> EvmDecodingOutput]]`
- rotkehlchen/chain/evm/decoding/velodrome/decoder.py:567:17 error[invalid-assignment] Invalid subscript assignment with key of type `ChecksumAddress` and value of type `tuple[(context) -> Unknown]` on object of type `dict[Unknown | ChecksumAddress, tuple[bound method Self@addresses_to_decoders._decode_voting_escrow_events(context: DecoderContext) -> EvmDecodingOutput] | tuple[bound method Self@addresses_to_decoders._decode_vote_events(context: DecoderContext) -> EvmDecodingOutput]]`
+ rotkehlchen/chain/evm/decoding/velodrome/decoder.py:567:17 error[invalid-assignment] Invalid subscript assignment with key of type `ChecksumAddress` and value of type `tuple[(context) -> EvmDecodingOutput]` on object of type `dict[Unknown | ChecksumAddress, tuple[bound method Self@addresses_to_decoders._decode_voting_escrow_events(context: DecoderContext) -> EvmDecodingOutput] | tuple[bound method Self@addresses_to_decoders._decode_vote_events(context: DecoderContext) -> EvmDecodingOutput]]`
+ rotkehlchen/chain/solana/decoding/decoder.py:627:21 error[invalid-argument-type] Argument to function `decode_safely` is incorrect: Expected `tuple[Any]`, found `SolanaEventDecoderContext | SolanaDecoderContext`
schemathesis (https://github.com/schemathesis/schemathesis)
+ src/schemathesis/specs/openapi/adapter/parameters.py:1139:45 error[invalid-argument-type] Argument to bound method `map` is incorrect: Expected `(GeneratedValue, /) -> Unknown`, found `def _quote_all_safe(value: dict[str, Any]) -> dict[str, Any]`
scikit-build-core (https://github.com/scikit-build/scikit-build-core)
- src/scikit_build_core/setuptools/build_cmake.py:228:5 error[invalid-assignment] Object of type `() -> Unknown` is not assignable to attribute `has_ext_modules` of type `def has_ext_modules(self) -> bool`
+ src/scikit_build_core/setuptools/build_cmake.py:228:5 error[invalid-assignment] Object of type `() -> bool` is not assignable to attribute `has_ext_modules` of type `def has_ext_modules(self) -> bool`
scipy (https://github.com/scipy/scipy)
+ scipy/stats/_kde.py:606:51 error[unsupported-operator] Operator `**` is not supported between objects of type `Unknown | (generic[Any] & ~str) | int | ... omitted 4 union elements` and `Literal[2]`
+ scipy/stats/_kde.py:621:52 error[unsupported-operator] Operator `**` is not supported between objects of type `Unknown | (generic[Any] & ~str) | int | ... omitted 4 union elements` and `Literal[2]`
+ scipy/stats/_sampling.py:698:16 error[unsupported-operator] Operator `<` is not supported between objects of type `(Unknown & ~None) | int | float | ... omitted 5 union elements` and `Any | int | float`
+ scipy/stats/_sampling.py:700:18 error[unsupported-operator] Operator `>` is not supported between objects of type `(Unknown & ~None) | int | float | ... omitted 5 union elements` and `Any | int | float`
+ scipy/stats/_sampling.py:921:20 error[unresolved-attribute] Attribute `squeeze` is not defined on `int`, `float` in union `Unknown | int | float`
+ scipy/stats/_sampling.py:926:24 error[unresolved-attribute] Attribute `reshape` is not defined on `int`, `float` in union `Unknown | int | float`
- scipy/stats/_sampling.py:707:13 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `None | int | float`, found `None | Unknown | generic[Any] | ... omitted 6 union elements`
+ scipy/stats/_sampling.py:707:13 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `None | int | float`, found `None | Unknown | int | ... omitted 6 union elements`
- scipy/stats/tests/test_sampling.py:525:5 error[unsupported-operator] Operator `+=` is not supported between objects of type `list[tuple[(x) -> Unknown, <class 'UNURANError'>, str]]` and `list[tuple[(x) -> Unknown, <class 'UNURANError'>, str] | tuple[(x) -> Unknown, <class 'TypeError'>, str] | tuple[(x) -> Unknown, <class 'NameError'>, str] | tuple[() -> Unknown, <class 'TypeError'>, str]]`
+ scipy/stats/tests/test_sampling.py:525:5 error[unsupported-operator] Operator `+=` is not supported between objects of type `list[tuple[(x) -> int, <class 'UNURANError'>, str]]` and `list[tuple[(x) -> Unknown, <class 'UNURANError'>, str] | tuple[(x) -> list[Unknown], <class 'TypeError'>, str] | tuple[(x) -> Unknown, <class 'NameError'>, str] | tuple[(x) -> int | float, <class 'UNURANError'>, str] | tuple[() -> int | float, <class 'TypeError'>, str]]`
- subprojects/cobyqa/cobyqa/main.py:1505:26 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `Literal["-", "+", " "] | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/main.py:1505:26 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `Literal["-", "+", " "] | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/main.py:1505:26 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `Literal["fixed", "unique", "maxprec", "maxprec_equal"] | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/main.py:1505:26 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `Literal["fixed", "unique", "maxprec", "maxprec_equal"] | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/main.py:1505:26 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `SupportsIndex | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/main.py:1505:26 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `SupportsIndex | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/main.py:1505:26 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `bool | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/main.py:1505:26 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `bool | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/main.py:1505:26 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `int | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/main.py:1505:26 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `int | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/main.py:1505:26 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `str | None`, found `int | dict[str, (x) -> Unknown]`
- subprojects/cobyqa/cobyqa/problem.py:75:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `Literal["-", "+", " "] | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/problem.py:75:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `Literal["-", "+", " "] | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/problem.py:75:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `SupportsIndex | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/problem.py:75:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `SupportsIndex | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/problem.py:75:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `_FormatDict | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/problem.py:75:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `_FormatDict | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/problem.py:75:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `int | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/problem.py:75:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `int | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/problem.py:75:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `int | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/problem.py:75:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `str | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/problem.py:75:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `str | None`, found `int | dict[str, (x) -> Unknown]`
- subprojects/cobyqa/cobyqa/problem.py:75:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `str | None`, found `int | dict[str, (x) -> Unknown]`
- subprojects/cobyqa/cobyqa/problem.py:469:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `((ndarray[tuple[Any, ...], dtype[Any]], /) -> str) | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/problem.py:469:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `((ndarray[tuple[Any, ...], dtype[Any]], /) -> str) | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/problem.py:469:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `Literal["-", "+", " "] | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/problem.py:469:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `Literal["-", "+", " "] | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/problem.py:469:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `Literal["1.13", "1.21", "1.25", "2.1", False] | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/problem.py:469:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `Literal["1.13", "1.21", "1.25", "2.1", False] | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/problem.py:469:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `Literal["fixed", "unique", "maxprec", "maxprec_equal"] | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/problem.py:469:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `Literal["fixed", "unique", "maxprec", "maxprec_equal"] | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/problem.py:469:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `_FormatDict | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/problem.py:469:38 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `_FormatDict | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/tests/test_problem.py:63:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `SupportsIndex | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/tests/test_problem.py:63:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `SupportsIndex | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/tests/test_problem.py:63:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `_FormatDict | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/tests/test_problem.py:63:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `_FormatDict | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/tests/test_problem.py:63:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `int | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/tests/test_problem.py:63:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `str | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/tests/test_problem.py:63:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `str | None`, found `int | dict[str, (x) -> Unknown]`
- subprojects/cobyqa/cobyqa/tests/test_problem.py:226:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `((ndarray[tuple[Any, ...], dtype[Any]], /) -> str) | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/tests/test_problem.py:226:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `((ndarray[tuple[Any, ...], dtype[Any]], /) -> str) | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/tests/test_problem.py:226:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `Literal["1.13", "1.21", "1.25", "2.1", False] | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/tests/test_problem.py:226:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `Literal["1.13", "1.21", "1.25", "2.1", False] | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/tests/test_problem.py:226:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `Literal["fixed", "unique", "maxprec", "maxprec_equal"] | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/tests/test_problem.py:226:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `Literal["fixed", "unique", "maxprec", "maxprec_equal"] | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/tests/test_problem.py:226:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `bool | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/tests/test_problem.py:226:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `bool | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/tests/test_problem.py:226:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `int | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/tests/test_problem.py:226:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `int | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/tests/test_problem.py:226:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `int | None`, found `int | dict[str, (x) -> Unknown]`
+ subprojects/cobyqa/cobyqa/tests/test_problem.py:226:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `str | None`, found `int | dict[str, (x) -> str]`
- subprojects/cobyqa/cobyqa/tests/test_problem.py:226:30 error[invalid-argument-type] Argument to function `printoptions` is incorrect: Expected `str | None`, found `int | dict[str, (x) -> Unknown]`
sockeye (https://github.com/awslabs/sockeye)
+ sockeye_contrib/plot_metrics.py:24:1 error[no-matching-overload] No overload of bound method `update` matches arguments
spack (https://github.com/spack/spack)
- lib/spack/spack/util/file_cache.py:159:76 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- lib/spack/spack/util/file_cache.py:175:77 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- lib/spack/spack/cmd/find.py:231:13 error[invalid-assignment] Invalid subscript assignment with key of type `Literal["start_date", "end_date"]` and value of type `datetime` on object of type `dict[str, InstallRecordStatus | None | ((x) -> Unknown) | bool]`
+ lib/spack/spack/cmd/find.py:231:13 error[invalid-assignment] Invalid subscript assignment with key of type `Literal["start_date", "end_date"]` and value of type `datetime` on object of type `dict[str, InstallRecordStatus | None | ((x) -> bool) | bool]`
- lib/spack/spack/spec.py:4050:60 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `defaultdict[Unknown, Unknown] | None`
+ lib/spack/spack/spec.py:4050:60 error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `defaultdict[Unknown, int] | None`
- lib/spack/spack/test/llnl/util/lock.py:1084:40 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `(() -> bool) | None | ContextManager[Unknown]`, found `def write(t, v, tb) -> Unknown`
- lib/spack/spack/test/llnl/util/lock.py:1090:36 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `(() -> bool) | None | ContextManager[Unknown]`, found `def write(t, v, tb) -> Unknown`
- lib/spack/spack/test/llnl/util/lock.py:1094:44 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `(() -> bool) | None | ContextManager[Unknown]`, found `def write(t, v, tb) -> Unknown`
- lib/spack/spack/test/llnl/util/lock.py:1103:40 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `(() -> bool) | None | ContextManager[Unknown]`, found `def write(t, v, tb) -> Unknown`
- lib/spack/spack/util/s3.py:61:16 error[invalid-argument-type] Method `__getitem__` of type `bound method dict[tuple[str, str], Any].__getitem__(key: tuple[str, str], /) -> Any` cannot be called with key of type `tuple[None | str | Unknown, Unknown | Literal["fetch"]]` on object of type `dict[tuple[str, str], Any]`
+ lib/spack/spack/util/s3.py:61:16 error[invalid-argument-type] Method `__getitem__` of type `bound method dict[tuple[str, str], Any].__getitem__(key: tuple[str, str], /) -> Any` cannot be called with key of type `tuple[None | str | UnspecializedTypeVar, Unknown | Literal["fetch"]]` on object of type `dict[tuple[str, str], Any]`
- lib/spack/spack/util/s3.py:75:5 error[invalid-assignment] Invalid subscript assignment with key of type `tuple[None | str | Unknown, Unknown | Literal["fetch"]]` and value of type `Unknown` on object of type `dict[tuple[str, str], Any]`
+ lib/spack/spack/util/s3.py:75:5 error[invalid-assignment] Invalid subscript assignment with key of type `tuple[None | str | UnspecializedTypeVar, Unknown | Literal["fetch"]]` and value of type `Unknown` on object of type `dict[tuple[str, str], Any]`
- lib/spack/spack/verify_libraries.py:165:17 error[invalid-assignment] Invalid subscript assignment with key of type `bytes | Unknown | str | PathLike[str] | PathLike[bytes]` and value of type `bytes | Unknown | str | PathLike[str] | PathLike[bytes]` on object of type `dict[bytes, bytes]`
+ lib/spack/spack/verify_libraries.py:165:17 error[invalid-assignment] Invalid subscript assignment with key of type `bytes | UnspecializedTypeVar | str | PathLike[str] | PathLike[bytes]` and value of type `bytes | UnspecializedTypeVar | str | PathLike[str] | PathLike[bytes]` on object of type `dict[bytes, bytes]`
- lib/spack/spack/verify_libraries.py:170:57 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[bytes]`, found `list[bytes | Unknown | str | PathLike[str] | PathLike[bytes]]`
+ lib/spack/spack/verify_libraries.py:170:57 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[bytes]`, found `list[bytes | UnspecializedTypeVar | str | PathLike[str] | PathLike[bytes]]`
sympy (https://github.com/sympy/sympy)
- sympy/core/singleton.py:236:9 error[invalid-assignment] Object of type `(obj) -> Unknown` is not assignable to attribute `__getstate__` of type `def __getstate__(self) -> object`
+ sympy/core/singleton.py:236:9 error[invalid-assignment] Object of type `(obj) -> None` is not assignable to attribute `__getstate__` of type `def __getstate__(self) -> object`
+ sympy/physics/mechanics/kane.py:448:21 error[no-matching-overload] No overload of bound method `fromkeys` matches arguments
+ sympy/physics/mechanics/tests/test_kane5.py:75:17 error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
- sympy/sets/tests/test_sets.py:59:9 error[invalid-assignment] Object of type `(x) -> Unknown` is not assignable to `def f(x) -> Unknown`
+ sympy/sets/tests/test_sets.py:59:9 error[invalid-assignment] Object of type `(x) -> cos` is not assignable to `def f(x) -> Unknown`
- sympy/strategies/traverse.py:35:30 error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Iterable[Unknown]`, found `Unknown | type`
+ sympy/strategies/traverse.py:35:30 error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Iterable[Unknown]`, found `Unknown | type | bool`
trio (https://github.com/python-trio/trio)
- src/trio/_core/_tests/test_run.py:1048:64 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/trio/_tests/test_util.py:139:32 error[invalid-argument-type] Argument to function `coroutine_or_error` is incorrect: Expected `(...) -> Awaitable[Unknown]`, found `() -> Deferred`
urllib3 (https://github.com/urllib3/urllib3)
- test/contrib/emscripten/test_emscripten.py:387:9 error[invalid-assignment] Object of type `() -> Unknown` is not assignable to attribute `is_cross_origin_isolated` of type `def is_cross_origin_isolated() -> bool`
+ test/contrib/emscripten/test_emscripten.py:387:9 error[invalid-assignment] Object of type `() -> Literal[False]` is not assignable to attribute `is_cross_origin_isolated` of type `def is_cross_origin_isolated() -> bool`
- test/test_poolmanager.py:316:9 error[invalid-assignment] Invalid subscript assignment with key of type `Literal["http"]` and value of type `(x) -> Unknown` on object of type `dict[str, partial[PoolKey]]`
+ test/test_poolmanager.py:316:9 error[invalid-assignment] Invalid subscript assignment with key of type `Literal["http"]` and value of type `(x) -> tuple[Unknown, ...]` on object of type `dict[str, partial[PoolKey]]`
vision (https://github.com/pytorch/vision)
+ references/depth/stereo/transforms.py:124:16 error[invalid-return-type] Return type does not match returned value: expected `tuple[tuple[Unknown, Unknown], tuple[Unknown | ndarray[tuple[Any, ...], dtype[Any]] | None, Unknown | ndarray[tuple[Any, ...], dtype[Any]] | None], tuple[Unknown | ndarray[tuple[Any, ...], dtype[Any]] | None, Unknown | ndarray[tuple[Any, ...], dtype[Any]] | None]]`, found `tuple[tuple[Unknown, ...], tuple[Unknown | None, ...], tuple[Unknown | None, ...]]`
- torchvision/transforms/v2/_auto_augment.py:423:75 error[invalid-argument-type] Argument to bound method `_get_random_item` is incorrect: Expected `dict[str, tuple[(...) -> Unknown, bool]]`, found `Unknown | dict[str, tuple[(num_bins, height, width) -> Unknown, bool]]`
+ torchvision/transforms/v2/_auto_augment.py:423:75 error[invalid-argument-type] Argument to bound method `_get_random_item` is incorrect: Expected `dict[str, tuple[(...) -> Unknown, bool]]`, found `Unknown | dict[str, tuple[(num_bins, height, width) -> None, bool] | tuple[(num_bins, height, width) -> Unknown, bool]]`
- torchvision/transforms/v2/_auto_augment.py:491:71 error[invalid-argument-type] Argument to bound method `_get_random_item` is incorrect: Expected `dict[str, tuple[(...) -> Unknown, bool]]`, found `Unknown | dict[str, tuple[(num_bins, height, width) -> Unknown, bool]]`
+ torchvision/transforms/v2/_auto_augment.py:491:71 error[invalid-argument-type] Argument to bound method `_get_random_item` is incorrect: Expected `dict[str, tuple[(...) -> Unknown, bool]]`, found `Unknown | dict[str, tuple[(num_bins, height, width) -> None, bool] | tuple[(num_bins, height, width) -> Unknown, bool]]`
zulip (https://github.com/zulip/zulip)
+ zerver/lib/upload/local.py:117:13 error[invalid-argument-type] Argument is incorrect: Expected `() -> ReadableStream`, found `() -> BufferedReader[_BufferedReaderStream]`
- zerver/views/streams.py:586:26 error[invalid-argument-type] Argument to function `compose_views` is incorrect: Expected `list[() -> HttpResponse]`, found `list[() -> Unknown]`
+ zerver/views/streams.py:586:26 error[invalid-argument-type] Argument to function `compose_views` is incorrect: Expected `list[() -> HttpResponse]`, found `list[() -> HttpResponse]`| reveal_type(self.c) | ||
|
|
||
| # revealed: (*, kw_only=...) -> Unknown | ||
| # revealed: (*, kw_only=...) -> Unknown | ((*, kw_only=...) -> Unknown) | ((*, kw_only=...) -> Divergent) | ((*, kw_only=...) -> Divergent) |
There was a problem hiding this comment.
The revealed type here is a little unfortunate. Ideally it would just be () -> Unknown | (() -> Divergent), but I'm not sure that is an issue related to this PR.
The weird typing- conformance comment should be fixed if you rebase that PR on main, and then this PR on that PR (sorry for the teething problems there with the new workflow...) |
|
There seems to be a new fuzzer panic |
fa2b058 to
109d2a5
Compare
af62f6c to
7d33c41
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
7d33c41 to
a8bb4fc
Compare
|
There is one new fuzzer panic: lambda: name_4
@lambda: name_5
class name_1:
pass
name_2 = [lambda: name_4, name_1]
if name_2:
@(*name_2,)
class name_3:
pass
assert unique_name_19
@lambda: name_3
class name_4[*name_2](0, name_1=name_3):
pass
try:
[name_5, name_4] = *name_4, = name_4
except* 0:
pass
else:
async def name_4():
pass
for name_3 in name_4:
passSalsa traceWe are now inferring the lambda bodies eagerly while inferring the outer scope, and so there is a cyclic dependency between |
a8bb4fc to
d050295
Compare
|
There is still a fuzzer panic on this. I'm going to move it to draft until that is resolved. |
Detailed analysis of the panic caused by eagerly inferring lambda bodies as part of their parent scope's inference. The cycle involves circular dependencies between name_4, name_2, name_3 through lambda body references, unpack assignments, and class decorators. Root cause: eager lambda body inference creates new dependency edges that form non-converging cycles when lambda bodies reference names involved in circular definition chains. https://claude.ai/code/session_01Unrae9uHg8UZ2um1EKH3py
…context When `infer_lambda_expression` eagerly infers the lambda body via `infer_scope_types`, it can introduce cycle edges: the lambda body may reference names whose definitions depend on this very expression (e.g. a lambda used as a decorator on a class that is referenced transitively by the lambda body). Without a Callable type context, the inferred return type participates in the cycle and can oscillate between iterations, causing a "too many cycle iterations" panic. Fix: only use the inferred body return type when a direct Callable type context is available (the main feature of PR #22633). Without a type context, fall back to `Unknown` for the return type while still inferring the body for diagnostics (reveal_type, etc.). https://claude.ai/code/session_0148KoTarLuZRPBttHzmZYEU
## Summary There are some issues with our current cycle handling, particularly with our implementation of `Type::cycle_normalized`. To prevent values from oscillating endlessly within a fixed-point iteration, `cycle_normalized` unions the type of the previous iteration with the current type. This ensures monotonicity of the type inference calculation. However, we've observed that always applying this union can sometimes produce undesirable results. Therefore, we make some exceptions where this union isn't applied (see #21909, #21910). However, these prescriptions are likely not exhaustive, and #22794 also confirmed the occurrence of "divergent pollution" when narrowing. The core issue in #22794 is that `Divergent` can inhibit narrowing. The result type itself does not contain `Divergent`, but `Divergent` indirectly affects it. This suggests that determining whether a type contains `Divergent` is not a perfect indicator of "taintedness". After carefully examining these cases, I found that the problematic "low-precision types" only appear in the first few iterations: `Divergent` itself and the type of the next iteration constructed by referencing it. Therefore, we shouldn't union these few iterations. I found that this simple change can remove all of the exceptional handling for `Divergent` introduced in #21909, #21910, and #22794. I also found that this change removes the too-many-cycle panic blocking #22633. ## Test Plan mdtest updated --------- Co-authored-by: Carl Meyer <carl@astral.sh>
b1c3340 to
a75fce6
Compare
Memory usage reportSummary
Significant changesClick to expand detailed breakdownprefect
sphinx
trio
flake8
|
|
The panic has been resolved by #23563, this should be ready to review. |
oconnor663
left a comment
There was a problem hiding this comment.
Apart from the *args comment, we got on a call and IIRC decided that we need a TODO for this case:
x = lambda: [1] # inferred: () -> list[int]
y: list[int | str] = x() # error[invalid-assignment]|
There are some new ecosystem false positives here that should be fixed by #23888. |
|
It also looks like there is a very large sympy regression... |
a157cbe to
aad2911
Compare
aad2911 to
a56892e
Compare
Infer lambda expressions eagerly as part of their parent scope, and with type context. This allows us to infer more precise types for lambda expressions, as well as perform check assignability against
Callableannotations.Note that this does not change the inferred type of a lambda parameter with the body of the lambda, even if it is annotated. That part is a little more tricky, so will be addressed in a followup PR.