Skip to content

[ty] Fix subtyping/assignability for @property protocol members#23034

Open
charliermarsh wants to merge 3 commits intomainfrom
charlie/protocol-property-check
Open

[ty] Fix subtyping/assignability for @property protocol members#23034
charliermarsh wants to merge 3 commits intomainfrom
charlie/protocol-property-check

Conversation

@charliermarsh
Copy link
Member

Summary

Attempting to revive #19936.

@charliermarsh charliermarsh added the ty Multi-file analysis & type inference label Feb 2, 2026
@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 2, 2026

Typing conformance results improved 🎉

The percentage of diagnostics emitted that were expected errors increased from 82.27% to 82.52%. The percentage of expected errors that received a diagnostic increased from 72.99% to 73.82%.

Summary

Metric Old New Diff Outcome
True Positives 789 798 +9 ⏫ (✅)
False Positives 170 169 -1 ⏬ (✅)
False Negatives 292 283 -9 ⏬ (✅)
Total Diagnostics 959 967 +8
Precision 82.27% 82.52% +0.25% ⏫ (✅)
Recall 72.99% 73.82% +0.83% ⏫ (✅)

True positives added

Details
Location Name Message
protocols_class_objects.py:104:16 invalid-assignment Object of type <class 'ConcreteC1'> is not assignable to ProtoC1
protocols_class_objects.py:106:16 invalid-assignment Object of type <class 'ConcreteC2'> is not assignable to ProtoC1
protocols_class_objects.py:74:16 invalid-assignment Object of type <class 'ConcreteB'> is not assignable to ProtoB1
protocols_definition.py:157:22 invalid-assignment Object of type Concrete3_Bad2 is not assignable to Template3
protocols_definition.py:158:22 invalid-assignment Object of type Concrete3_Bad3 is not assignable to Template3
protocols_definition.py:218:22 invalid-assignment Object of type Concrete4_Bad1 is not assignable to Template4
protocols_definition.py:339:22 invalid-assignment Object of type Concrete6_Bad1 is not assignable to Template6
protocols_definition.py:340:22 invalid-assignment Object of type Concrete6_Bad2 is not assignable to Template6
protocols_definition.py:341:22 invalid-assignment Object of type Concrete6_Bad3 is not assignable to Template6

False positives removed

Details
Location Name Message
protocols_modules.py:47:18 invalid-assignment Object of type <module '_protocols_modules2'> is not assignable to Reporter1

@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 2, 2026

mypy_primer results

Changes were detected when running on open source projects
itsdangerous (https://github.com/pallets/itsdangerous)
- src/itsdangerous/serializer.py:95:51: error[invalid-assignment] Object of type `<module 'json'>` is not assignable to `_PDataSerializer[Any]`
- Found 2 diagnostics
+ Found 1 diagnostic

pip (https://github.com/pypa/pip)
+ src/pip/_internal/network/auth.py:336:16: error[invalid-return-type] Return type does not match returned value: expected `str | None`, found `Literal[b""]`
- src/pip/_vendor/urllib3/util/ssl_.py:359:13: error[invalid-assignment] Object of type `str & ~AlwaysFalsy` is not assignable to attribute `keylog_filename` on type `(Unknown & <Protocol with members 'keylog_filename'>) | ssl.SSLContext | (pip._vendor.urllib3.util.ssl_.SSLContext & <Protocol with members 'keylog_filename'>)`

aiortc (https://github.com/aiortc/aiortc)
- src/aiortc/rtcrtpsender.py:290:25: error[invalid-assignment] Object of type `int` is not assignable to attribute `target_bitrate` on type `Encoder & <Protocol with members 'target_bitrate'> & ~AlwaysFalsy`
- Found 194 diagnostics
+ Found 193 diagnostics

rich (https://github.com/Textualize/rich)
+ tests/test_ratio.py:30:31: error[invalid-argument-type] Argument to function `ratio_resolve` is incorrect: Expected `Sequence[rich._ratio.Edge]`, found `list[tests.test_ratio.Edge]`
+ tests/test_ratio.py:31:31: error[invalid-argument-type] Argument to function `ratio_resolve` is incorrect: Expected `Sequence[rich._ratio.Edge]`, found `list[tests.test_ratio.Edge]`
+ tests/test_ratio.py:32:31: error[invalid-argument-type] Argument to function `ratio_resolve` is incorrect: Expected `Sequence[rich._ratio.Edge]`, found `list[tests.test_ratio.Edge]`
+ tests/test_ratio.py:33:31: error[invalid-argument-type] Argument to function `ratio_resolve` is incorrect: Expected `Sequence[rich._ratio.Edge]`, found `list[tests.test_ratio.Edge]`
+ tests/test_ratio.py:38:31: error[invalid-argument-type] Argument to function `ratio_resolve` is incorrect: Expected `Sequence[rich._ratio.Edge]`, found `list[tests.test_ratio.Edge]`
+ tests/test_ratio.py:44:14: error[invalid-argument-type] Argument to function `ratio_resolve` is incorrect: Expected `Sequence[rich._ratio.Edge]`, found `list[tests.test_ratio.Edge]`
+ tests/test_ratio.py:46:31: error[invalid-argument-type] Argument to function `ratio_resolve` is incorrect: Expected `Sequence[rich._ratio.Edge]`, found `list[tests.test_ratio.Edge]`
+ tests/test_ratio.py:52:13: error[invalid-argument-type] Argument to function `ratio_resolve` is incorrect: Expected `Sequence[rich._ratio.Edge]`, found `list[tests.test_ratio.Edge]`
+ tests/test_ratio.py:54:31: error[invalid-argument-type] Argument to function `ratio_resolve` is incorrect: Expected `Sequence[rich._ratio.Edge]`, found `list[tests.test_ratio.Edge]`
- Found 354 diagnostics
+ Found 363 diagnostics

kopf (https://github.com/nolar/kopf)
- kopf/_cogs/configs/configuration.py:350:13: error[invalid-assignment] Object of type `int` is not assignable to attribute `_max_workers` on type `Executor & <Protocol with members '_max_workers'>`
- Found 293 diagnostics
+ Found 292 diagnostics

PyGithub (https://github.com/PyGithub/PyGithub)
- github/GithubObject.py:309:45: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- github/GithubObject.py:316:44: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- github/GithubObject.py:376:44: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- github/GithubObject.py:400:44: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- github/GithubObject.py:414:44: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- Found 325 diagnostics
+ Found 320 diagnostics

pydantic (https://github.com/pydantic/pydantic)
- pydantic/_internal/_core_metadata.py:87:54: error[invalid-assignment] Invalid assignment to key "pydantic_js_extra" with declared type `dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | ((dict[str, int | float | str | ... omitted 3 union elements], type[Any], /) -> None)` on TypedDict `CoreMetadata`: value of type `dict[object, object]`
+ pydantic/_internal/_core_metadata.py:87:54: error[invalid-assignment] Invalid assignment to key "pydantic_js_extra" with declared type `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | ((dict[str, Divergent], type[Any], /) -> None)` on TypedDict `CoreMetadata`: value of type `dict[object, object]`
- pydantic/fields.py:949:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None`
+ pydantic/fields.py:949:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`
- pydantic/fields.py:989:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None`
+ pydantic/fields.py:989:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`
- pydantic/fields.py:1032:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None`
+ pydantic/fields.py:1032:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`
- pydantic/fields.py:1072:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None`
+ pydantic/fields.py:1072:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`
- pydantic/fields.py:1115:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None`
+ pydantic/fields.py:1115:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`
- pydantic/fields.py:1154:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None`
+ pydantic/fields.py:1154:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`
- pydantic/fields.py:1194:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None`
+ pydantic/fields.py:1194:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`
- pydantic/fields.py:1573:13: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None`, found `Top[dict[Unknown, Unknown]] | (((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) & ~Top[dict[Unknown, Unknown]]) | None`
+ pydantic/fields.py:1573:13: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`, found `Top[dict[Unknown, Unknown]] | (((dict[str, Divergent], /) -> None) & ~Top[dict[Unknown, Unknown]]) | None`

trio (https://github.com/python-trio/trio)
- src/trio/_util.py:219:17: error[invalid-assignment] Cannot assign to read-only property `__name__` on object of type `<Protocol with members '__name__'>`
- src/trio/_util.py:221:21: error[invalid-assignment] Object of type `str` is not assignable to attribute `__qualname__` on type `<Protocol with members '__name__'> & <Protocol with members '__qualname__'>`
- Found 471 diagnostics
+ Found 469 diagnostics

cibuildwheel (https://github.com/pypa/cibuildwheel)
- cibuildwheel/platforms/__init__.py:31:67: error[invalid-assignment] Object of type `dict[Literal["linux", "macos", "windows", "pyodide", "android", "ios"], PlatformModule | ModuleType]` is not assignable to `dict[Literal["linux", "macos", "windows", "pyodide", "android", "ios"], PlatformModule]`
- Found 29 diagnostics
+ Found 28 diagnostics

openlibrary (https://github.com/internetarchive/openlibrary)
+ openlibrary/plugins/upstream/utils.py:1532:20: error[invalid-return-type] Return type does not match returned value: expected `str`, found `Literal[b""]`
- Found 1127 diagnostics
+ Found 1128 diagnostics

cwltool (https://github.com/common-workflow-language/cwltool)
- cwltool/executors.py:217:25: error[invalid-assignment] Object of type `Builder` is not assignable to attribute `builder` on type `JobBase | (WorkflowJob & <Protocol with members 'builder'>) | ExpressionJob | (CallbackJob & <Protocol with members 'builder'>)`
- Found 511 diagnostics
+ Found 510 diagnostics

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
- pymongo/ssl_support.py:105:13: error[invalid-assignment] Object of type `bool` is not assignable to attribute `check_ocsp_endpoint` on type `pymongo.pyopenssl_context.SSLContext | (ssl.SSLContext & <Protocol with members 'check_ocsp_endpoint'>)`
- Found 442 diagnostics
+ Found 441 diagnostics

setuptools (https://github.com/pypa/setuptools)
- setuptools/command/editable_wheel.py:247:17: error[invalid-assignment] Object of type `Literal[True]` is not assignable to attribute `editable_mode` on type `Command & <Protocol with members 'editable_mode'>`
- setuptools/command/editable_wheel.py:249:17: error[invalid-assignment] Object of type `Literal[True]` is not assignable to attribute `inplace` on type `Command & <Protocol with members 'inplace'> & ~<Protocol with members 'editable_mode'>`
- Found 1140 diagnostics
+ Found 1138 diagnostics

hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
+ src/hydra_zen/structured_configs/_type_guards.py:80:32: error[invalid-argument-type] Argument to function `_get_target` is incorrect: Expected `HasTarget`, found `<class 'Just'>`
- Found 519 diagnostics
+ Found 520 diagnostics

scipy-stubs (https://github.com/scipy/scipy-stubs)
+ scipy-stubs/sparse/_dok.pyi:159:9: error[invalid-method-override] Invalid override of method `fromkeys`: Definition is incompatible with `dict.fromkeys`
+ scipy-stubs/sparse/_dok.pyi:535:9: error[invalid-method-override] Invalid override of method `__getitem__`: Definition is incompatible with `IndexMixin.__getitem__`
- tests/sparse/test_data.pyi:46:1: error[type-assertion-failure] Type `bsr_array[floating[_32Bit]]` does not match asserted type `Unknown`
- tests/sparse/test_data.pyi:51:1: error[type-assertion-failure] Type `bsr_matrix[floating[_32Bit]]` does not match asserted type `Unknown`
- tests/sparse/test_data.pyi:59:1: error[type-assertion-failure] Type `coo_array[floating[_32Bit], tuple[int, int]]` does not match asserted type `Unknown`
- tests/sparse/test_data.pyi:64:1: error[type-assertion-failure] Type `coo_matrix[floating[_32Bit]]` does not match asserted type `Unknown`
- tests/sparse/test_data.pyi:72:1: error[type-assertion-failure] Type `csc_array[floating[_32Bit]]` does not match asserted type `Unknown`
- tests/sparse/test_data.pyi:77:1: error[type-assertion-failure] Type `csc_matrix[floating[_32Bit]]` does not match asserted type `Unknown`
- tests/sparse/test_data.pyi:85:1: error[type-assertion-failure] Type `csr_array[floating[_32Bit], tuple[int, int]]` does not match asserted type `Unknown`
- tests/sparse/test_data.pyi:90:1: error[type-assertion-failure] Type `csr_matrix[floating[_32Bit]]` does not match asserted type `Unknown`
- tests/sparse/test_data.pyi:98:1: error[type-assertion-failure] Type `dia_array[floating[_32Bit]]` does not match asserted type `Unknown`
- tests/sparse/test_data.pyi:103:1: error[type-assertion-failure] Type `dia_matrix[floating[_32Bit]]` does not match asserted type `Unknown`
+ tests/sparse/test_dok.pyi:58:1: error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: CanArrayND[numpy.bool[builtins.bool] | integer, tuple[Any, ...]] | list[int] | slice[Any, Any, Any], /) -> dok_array[floating[_32Bit], tuple[int]], [_ScalarT, _ShapeT](key: _spbase[numpy.bool[builtins.bool], _ShapeT], /) -> dok_array[_ScalarT, _ShapeT], [_ScalarT](key: JustInt | numpy.integer[Any] | tuple[ToJustInt], /) -> Any, [_ScalarT](key: tuple[ToJustInt, ToJustInt], /) -> _ScalarT, [_ScalarT](key: JustInt | numpy.integer[Any] | tuple[ToJustInt], /) -> _ScalarT, [_ScalarT](key: JustInt | numpy.integer[Any] | tuple[ToJustInt], /) -> coo_array[_ScalarT, tuple[int]]]` cannot be called with key of type `tuple[Literal[0], Literal[0]]` on object of type `dok_array[floating[_32Bit], tuple[int]]`
- tests/sparse/test_dok.pyi:59:1: error[type-assertion-failure] Type `floating[_32Bit]` does not match asserted type `Any`
- tests/sparse/test_dok.pyi:60:1: error[type-assertion-failure] Type `floating[_32Bit]` does not match asserted type `dok_matrix[floating[_32Bit]]`
- tests/special/test_orthogonal.pyi:101:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `complex128`
- tests/special/test_orthogonal.pyi:102:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `complex128`
- tests/special/test_orthogonal.pyi:104:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `complex128`
- tests/special/test_orthogonal.pyi:105:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `complex128`
- tests/stats/test_distribution_infrastructure.pyi:97:56: error[invalid-argument-type] Argument to function `make_distribution` is incorrect: Expected `rv_continuous | <class '_DuckDistributionSingle'>`, found `<class '_DuckRV'>`
+ tests/stats/test_distribution_infrastructure.pyi:97:56: error[invalid-argument-type] Argument to function `make_distribution` is incorrect: Expected `rv_continuous | <class '_DuckDistributionSingle'> | <class '_DuckDistributionMulti'>`, found `<class '_DuckRV'>`
- tests/stats/test_distribution_infrastructure.pyi:98:56: error[invalid-argument-type] Argument to function `make_distribution` is incorrect: Expected `rv_continuous | <class '_DuckDistributionSingle'>`, found `<class '_MultiDuckRV'>`
+ tests/stats/test_distribution_infrastructure.pyi:98:56: error[invalid-argument-type] Argument to function `make_distribution` is incorrect: Expected `rv_continuous | <class '_DuckDistributionSingle'> | <class '_DuckDistributionMulti'>`, found `<class '_MultiDuckRV'>`
- Found 1449 diagnostics
+ Found 1436 diagnostics

xarray (https://github.com/pydata/xarray)
- xarray/core/common.py:1707:17: error[no-matching-overload] No overload of bound method `get` matches arguments
- xarray/namedarray/pycompat.py:147:34: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- Found 1714 diagnostics
+ Found 1712 diagnostics

pwndbg (https://github.com/pwndbg/pwndbg)
- pwndbg/libc/facade.py:28:51: error[invalid-assignment] Object of type `tuple[<module 'pwndbg.libc.glibc'>, <module 'pwndbg.libc.musl'>, <module 'pwndbg.libc.unknown'>]` is not assignable to `tuple[LibcProvider, ...]`
- pwndbg/libc/facade.py:52:16: error[invalid-return-type] Return type does not match returned value: expected `tuple[bool, LibcProvider]`, found `tuple[Literal[False], <module 'pwndbg.libc.unknown'>]`
- pwndbg/libc/facade.py:59:16: error[invalid-return-type] Return type does not match returned value: expected `tuple[bool, LibcProvider]`, found `tuple[Literal[False], <module 'pwndbg.libc.unknown'>]`
- pwndbg/libc/facade.py:238:16: error[invalid-return-type] Return type does not match returned value: expected `tuple[Path, Path, LibcProvider]`, found `tuple[Path, Path, <module 'pwndbg.libc.unknown'>]`
- pwndbg/libc/facade.py:240:16: error[invalid-return-type] Return type does not match returned value: expected `tuple[Path, Path, LibcProvider]`, found `tuple[Path, Path, <module 'pwndbg.libc.unknown'>]`
- pwndbg/libc/facade.py:242:16: error[invalid-return-type] Return type does not match returned value: expected `tuple[Path, Path, LibcProvider]`, found `tuple[Path, Path, <module 'pwndbg.libc.unknown'>]`
- Found 1965 diagnostics
+ Found 1959 diagnostics

strawberry (https://github.com/strawberry-graphql/strawberry)
- strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py:182:13: error[invalid-assignment] Object of type `dict[str, object] | dict[Unknown, Unknown]` is not assignable to attribute `connection_params` on type `(Unknown & <Protocol with members 'connection_params'> & ~Top[dict[Unknown, Unknown]]) | (Context@BaseGraphQLTransportWSHandler & <Protocol with members 'connection_params'> & ~Top[dict[Unknown, Unknown]])`
- strawberry/subscriptions/protocols/graphql_ws/handlers.py:103:13: error[invalid-assignment] Object of type `None | dict[str, object]` is not assignable to attribute `connection_params` on type `(Unknown & <Protocol with members 'connection_params'> & ~Top[dict[Unknown, Unknown]]) | (Context@BaseGraphQLWSHandler & <Protocol with members 'connection_params'> & ~Top[dict[Unknown, Unknown]])`
- Found 344 diagnostics
+ Found 342 diagnostics

dd-trace-py (https://github.com/DataDog/dd-trace-py)
- ddtrace/appsec/_iast/_ast/visitor.py:675:17: error[invalid-assignment] Object of type `Load` is not assignable to attribute `ctx` on type `expr & <Protocol with members 'ctx'>`
- Found 9341 diagnostics
+ Found 9340 diagnostics

pycryptodome (https://github.com/Legrandin/pycryptodome)
+ lib/Crypto/Cipher/PKCS1_OAEP.py:73:49: error[invalid-argument-type] Argument is incorrect: Expected `Hash | HashModule`, found `Unknown | <module 'Crypto.Hash.SHA1'>`
+ lib/Crypto/SelfTest/Cipher/test_pkcs1_oaep.py:342:49: error[invalid-argument-type] Argument to function `new` is incorrect: Expected `HashLikeClass | None`, found `<module 'Crypto.Hash.MD2'> | <module 'Crypto.Hash.MD5'> | <module 'Crypto.Hash.SHA1'> | <module 'Crypto.Hash.SHA256'> | <module 'Crypto.Hash.RIPEMD160'>`
+ lib/Crypto/SelfTest/Cipher/test_pkcs1_oaep.py:416:48: error[invalid-argument-type] Argument is incorrect: Expected `Hash | HashModule`, found `<module 'Crypto.Hash.SHA1'>`
+ lib/Crypto/SelfTest/Cipher/test_pkcs1_oaep.py:418:48: error[invalid-argument-type] Argument is incorrect: Expected `Hash | HashModule`, found `<module 'Crypto.Hash.SHA224'>`
+ lib/Crypto/SelfTest/Cipher/test_pkcs1_oaep.py:420:48: error[invalid-argument-type] Argument is incorrect: Expected `Hash | HashModule`, found `<module 'Crypto.Hash.SHA256'>`
+ lib/Crypto/SelfTest/Cipher/test_pkcs1_oaep.py:422:48: error[invalid-argument-type] Argument is incorrect: Expected `Hash | HashModule`, found `<module 'Crypto.Hash.SHA384'>`
+ lib/Crypto/SelfTest/Cipher/test_pkcs1_oaep.py:424:48: error[invalid-argument-type] Argument is incorrect: Expected `Hash | HashModule`, found `<module 'Crypto.Hash.SHA512'>`
- Found 1327 diagnostics
+ Found 1334 diagnostics

hydpy (https://github.com/hydpy-dev/hydpy)
- hydpy/core/masktools.py:43:16: error[invalid-return-type] Return type does not match returned value: expected `Self@array2mask`, found `ndarray[tuple[Any, ...], Unknown]`
- hydpy/core/sequencetools.py:393:9: error[unresolved-attribute] Unresolved attribute `aggregation` on type `ndarray[tuple[Any, ...], Unknown]`
- hydpy/core/sequencetools.py:394:16: error[invalid-return-type] Return type does not match returned value: expected `InfoArray`, found `ndarray[tuple[Any, ...], Unknown]`
- Found 661 diagnostics
+ Found 658 diagnostics

pandas (https://github.com/pandas-dev/pandas)
- pandas/core/arrays/period.py:1471:12: error[invalid-return-type] Return type does not match returned value: expected `tuple[ndarray[tuple[Any, ...], dtype[Any]], BaseOffset]`, found `tuple[ndarray[tuple[Any, ...], dtype[Unknown]], BaseOffset | Unknown | None]`
+ pandas/core/arrays/period.py:1471:12: error[invalid-return-type] Return type does not match returned value: expected `tuple[ndarray[tuple[Any, ...], dtype[Any]], BaseOffset]`, found `tuple[ndarray[tuple[Any, ...], dtype[signedinteger[_64Bit]]], BaseOffset | Unknown | None]`
- pandas/core/arrays/timedeltas.py:251:41: error[invalid-argument-type] Argument to function `datetime_data` is incorrect: Expected `str | _HasDType[dtype[datetime64[date | int | None] | timedelta64[timedelta | int | None]]] | dtype[datetime64[date | int | None] | timedelta64[timedelta | int | None]] | _HasNumPyDType[dtype[datetime64[date | int | None] | timedelta64[timedelta | int | None]]]`, found `dtype[Any] | ExtensionDtype`
+ pandas/core/arrays/timedeltas.py:251:41: error[invalid-argument-type] Argument to function `datetime_data` is incorrect: Expected `str | type[datetime64[date | int | None] | timedelta64[timedelta | int | None]] | dtype[datetime64[date | int | None] | timedelta64[timedelta | int | None]] | _HasDType[dtype[datetime64[date | int | None] | timedelta64[timedelta | int | None]]] | _HasNumPyDType[dtype[datetime64[date | int | None] | timedelta64[timedelta | int | None]]]`, found `dtype[Any] | ExtensionDtype`
- pandas/core/arrays/timedeltas.py:277:41: error[invalid-argument-type] Argument to function `datetime_data` is incorrect: Expected `str | _HasDType[dtype[datetime64[date | int | None] | timedelta64[timedelta | int | None]]] | dtype[datetime64[date | int | None] | timedelta64[timedelta | int | None]] | _HasNumPyDType[dtype[datetime64[date | int | None] | timedelta64[timedelta | int | None]]]`, found `dtype[Any] | ExtensionDtype`
+ pandas/core/arrays/timedeltas.py:277:41: error[invalid-argument-type] Argument to function `datetime_data` is incorrect: Expected `str | type[datetime64[date | int | None] | timedelta64[timedelta | int | None]] | dtype[datetime64[date | int | None] | timedelta64[timedelta | int | None]] | _HasDType[dtype[datetime64[date | int | None] | timedelta64[timedelta | int | None]]] | _HasNumPyDType[dtype[datetime64[date | int | None] | timedelta64[timedelta | int | None]]]`, found `dtype[Any] | ExtensionDtype`
- pandas/core/dtypes/cast.py:501:42: error[invalid-argument-type] Argument to function `datetime_data` is incorrect: Expected `str | _HasDType[dtype[datetime64[date | int | None] | timedelta64[timedelta | int | None]]] | dtype[datetime64[date | int | None] | timedelta64[timedelta | int | None]] | _HasNumPyDType[dtype[datetime64[date | int | None] | timedelta64[timedelta | int | None]]]`, found `Unknown | int | float`
+ pandas/core/dtypes/cast.py:501:42: error[invalid-argument-type] Argument to function `datetime_data` is incorrect: Expected `str | type[datetime64[date | int | None] | timedelta64[timedelta | int | None]] | dtype[datetime64[date | int | None] | timedelta64[timedelta | int | None]] | _HasDType[dtype[datetime64[date | int | None] | timedelta64[timedelta | int | None]]] | _HasNumPyDType[dtype[datetime64[date | int | None] | timedelta64[timedelta | int | None]]]`, found `Unknown | int | float`
- pandas/core/frame.py:13323:23: error[invalid-assignment] Object of type `Top[list[Unknown]] & ~AlwaysFalsy` is not assignable to `list[Hashable]`
- pandas/core/indexers/utils.py:575:23: warning[possibly-missing-attribute] Attribute `to_numpy` may be missing on object of type `(Any & ~tuple[object, ...]) | ExtensionArray | ndarray[tuple[Any, ...], dtype[Unknown]]`
+ pandas/core/indexers/utils.py:575:23: warning[possibly-missing-attribute] Attribute `to_numpy` may be missing on object of type `(Any & ~tuple[object, ...]) | ExtensionArray | ndarray[tuple[Any, ...], dtype[signedinteger[_64Bit]]]`
- pandas/core/indexes/base.py:1882:16: error[invalid-return-type] Return type does not match returned value: expected `list[Hashable]`, found `(Top[list[Unknown]] & ~AlwaysFalsy) | list[Hashable] | list[Unknown | None] | list[Unknown | (Hashable & ~None)]`
+ pandas/io/common.py:919:24: error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `BaseBuffer`, found `(GzipFile & ~str) | (IO[bytes] & ~str) | (Unknown & ~str)`
+ pandas/io/common.py:947:54: error[invalid-argument-type] Argument to function `_is_binary_mode` is incorrect: Expected `str | PathLike[str] | BaseBuffer`, found `(BaseBuffer & ~str) | (GzipFile & ~str) | (Unknown & ~str) | IO[Any]`
- pandas/io/formats/excel.py:729:31: error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]] | tuple[ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]], ...], /) -> ndarray[tuple[Any, ...], dtype[object]], (key: SupportsIndex | tuple[SupportsIndex, ...], /) -> Any, (key: SupportsIndex | slice[Any, Any, Any] | EllipsisType | ... omitted 5 union elements, /) -> ndarray[tuple[Any, ...], dtype[object]], (key: str, /) -> ndarray[tuple[object, ...], dtype[Any]], (key: list[str], /) -> ndarray[tuple[object, ...], Unknown]]` cannot be called with key of type `Literal[0]` on object of type `ndarray[tuple[object, ...], dtype[object]]`
- pandas/io/formats/excel.py:785:34: error[not-iterable] Object of type `Unknown | (Top[list[Unknown]] & ~AlwaysFalsy) | (tuple[object, ...] & ~AlwaysFalsy) | (ndarray[tuple[object, ...], dtype[object]] & ~AlwaysFalsy) | (Index & ~AlwaysFalsy)` may not be iterable
- pandas/tests/arrays/sparse/test_accessor.py:229:13: error[invalid-argument-type] Argument to bound method `from_tuples` is incorrect: Expected `Iterable[tuple[Hashable, ...]]`, found `list[ndarray[tuple[Any, ...], dtype[Unknown]]]`
+ pandas/tests/arrays/sparse/test_accessor.py:229:13: error[invalid-argument-type] Argument to bound method `from_tuples` is incorrect: Expected `Iterable[tuple[Hashable, ...]]`, found `list[ndarray[tuple[Any, ...], dtype[signedinteger[_32Bit]]]]`
- pandas/tests/frame/test_constructors.py:2795:17: error[unresolved-attribute] Unresolved attribute `name` on type `ndarray[tuple[Any, ...], Unknown]`
+ pandas/tests/frame/test_constructors.py:2795:17: error[unresolved-attribute] Unresolved attribute `name` on type `Self@__new__`
+ pandas/tests/groupby/test_cumulative.py:33:9: error[no-matching-overload] No overload of bound method `__init__` matches arguments
+ pandas/tests/groupby/test_cumulative.py:35:14: error[no-matching-overload] No overload of function `__new__` matches arguments
+ pandas/tests/groupby/test_cumulative.py:38:9: error[no-matching-overload] No overload of bound method `__init__` matches arguments
+ pandas/tests/groupby/test_cumulative.py:40:14: error[no-matching-overload] No overload of function `__new__` matches arguments
+ pandas/tests/io/test_stata.py:1878:25: error[invalid-argument-type] Argument to bound method `to_stata` is incorrect: Expected `str | PathLike[str] | WriteBuffer[bytes]`, found `GzipFile`
+ pandas/tests/io/test_stata.py:1880:33: error[invalid-argument-type] Argument to function `read_stata` is incorrect: Expected `str | PathLike[str] | ReadBuffer[bytes]`, found `GzipFile`
+ pandas/tests/scalar/timedelta/test_arithmetic.py:444:15: error[unsupported-operator] Operator `*` is not supported between objects of type `Timedelta` and `ndarray[tuple[Any, ...], dtype[signedinteger[_64Bit]]]`
+ pandas/tests/scalar/timedelta/test_arithmetic.py:448:15: error[unsupported-operator] Operator `*` is not supported between objects of type `ndarray[tuple[Any, ...], dtype[signedinteger[_64Bit]]]` and `Timedelta`
+ pandas/tests/scalar/timedelta/test_arithmetic.py:601:13: error[unsupported-operator] Operator `/` is not supported between objects of type `ndarray[tuple[Any, ...], dtype[float64]]` and `Timedelta`
- pandas/tests/tseries/offsets/test_offsets.py:986:14: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `ndarray[tuple[Any, ...], dtype[Unknown]]`
+ pandas/tests/tseries/offsets/test_offsets.py:986:14: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `ndarray[tuple[Any, ...], dtype[signedinteger[_64Bit]]]`
- Found 4437 diagnostics
+ Found 4444 diagnostics

scikit-learn (https://github.com/scikit-learn/scikit-learn)
- sklearn/decomposition/_nmf.py:138:15: error[unsupported-operator] Operator `>` is not supported between objects of type `Unknown | memoryview[int] | ndarray[tuple[int], dtype[Unknown]]` and `floating[Any]`
+ sklearn/decomposition/_nmf.py:138:15: error[unsupported-operator] Operator `>` is not supported between objects of type `Unknown | memoryview[int] | ndarray[tuple[int], dtype[Unknown]]` and `floating[_32Bit]`
+ sklearn/preprocessing/_data.py:3403:68: error[not-subscriptable] Cannot subscript object of type `float64` with no `__getitem__` method
- sklearn/utils/tests/test_extmath.py:1084:20: error[unresolved-attribute] Object of type `spmatrix[cfloating]` has no attribute `toarray`
- sklearn/utils/tests/test_multiclass.py:399:27: warning[possibly-missing-attribute] Attribute `toarray` may be missing on object of type `(Unknown & SparseABC) | (list[Unknown | list[Unknown | int]] & SparseABC) | (ndarray[tuple[Any, ...], dtype[Any]] & SparseABC) | ... omitted 12 union elements`
+ sklearn/utils/tests/test_multiclass.py:399:27: warning[possibly-missing-attribute] Attribute `toarray` may be missing on object of type `(Unknown & SparseABC) | (list[Unknown | list[Unknown | int]] & SparseABC) | (ndarray[tuple[Any, ...], dtype[Any]] & SparseABC) | ... omitted 15 union elements`

materialize (https://github.com/MaterializeInc/materialize)
+ misc/python/materialize/cli/mz_workload_anonymize.py:251:13: error[no-matching-overload] No overload of bound method `join` matches arguments
- Found 534 diagnostics
+ Found 535 diagnostics

sympy (https://github.com/sympy/sympy)
- sympy/algebras/quaternion.py:132:22: error[invalid-assignment] Object of type `Basic` is not assignable to `Expr | int | float | complex`
+ sympy/algebras/quaternion.py:132:22: error[invalid-assignment] Object of type `Basic | int | float | complex | Any` is not assignable to `Expr | int | float | complex`
- sympy/algebras/quaternion.py:132:22: error[invalid-assignment] Object of type `Basic` is not assignable to `Expr | int | float | complex`
+ sympy/algebras/quaternion.py:132:22: error[invalid-assignment] Object of type `Basic | int | float | complex | Any` is not assignable to `Expr | int | float | complex`
- sympy/algebras/quaternion.py:132:22: error[invalid-assignment] Object of type `Basic` is not assignable to `Expr | int | float | complex`
+ sympy/algebras/quaternion.py:132:22: error[invalid-assignment] Object of type `Basic | int | float | complex | Any` is not assignable to `Expr | int | float | complex`
- sympy/algebras/quaternion.py:132:22: error[invalid-assignment] Object of type `Basic` is not assignable to `Expr | int | float | complex`
+ sympy/algebras/quaternion.py:132:22: error[invalid-assignment] Object of type `Basic | int | float | complex | Any` is not assignable to `Expr | int | float | complex`
+ sympy/algebras/tests/test_quaternion.py:75:10: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/algebras/tests/test_quaternion.py:75:10: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
- sympy/functions/combinatorial/factorials.py:967:13: error[unsupported-operator] Operator `-` is not supported between two objects of type `Basic`
+ sympy/functions/combinatorial/factorials.py:967:13: error[unsupported-operator] Operator `-` is not supported between two objects of type `Basic | int | float | complex | Any`
+ sympy/functions/combinatorial/factorials.py:968:29: warning[possibly-missing-attribute] Attribute `is_nonnegative` may be missing on object of type `Basic | int | float | complex | Any`
+ sympy/functions/combinatorial/factorials.py:968:47: warning[possibly-missing-attribute] Attribute `is_integer` may be missing on object of type `Basic | int | float | complex | Any`
+ sympy/functions/combinatorial/factorials.py:969:12: warning[possibly-missing-attribute] Attribute `is_zero` may be missing on object of type `Basic | int | float | complex | Any`
- sympy/functions/combinatorial/factorials.py:972:13: error[unsupported-operator] Operator `-` is not supported between objects of type `Basic` and `Literal[1]`
+ sympy/functions/combinatorial/factorials.py:972:13: error[unsupported-operator] Operator `-` is not supported between objects of type `Basic | int | float | complex | Any` and `Literal[1]`
+ sympy/functions/combinatorial/factorials.py:975:12: warning[possibly-missing-attribute] Attribute `is_integer` may be missing on object of type `Basic | int | float | complex | Any`
+ sympy/functions/combinatorial/factorials.py:976:16: warning[possibly-missing-attribute] Attribute `is_negative` may be missing on object of type `Basic | int | float | complex | Any`
+ sympy/functions/combinatorial/factorials.py:978:18: warning[possibly-missing-attribute] Attribute `is_number` may be missing on object of type `Basic | int | float | complex | Any`
+ sympy/functions/combinatorial/factorials.py:984:14: warning[possibly-missing-attribute] Attribute `is_number` may be missing on object of type `Basic | int | float | complex | Any`
- sympy/functions/combinatorial/factorials.py:986:26: error[unsupported-operator] Operator `+` is not supported between objects of type `Basic` and `Literal[1]`
+ sympy/functions/combinatorial/factorials.py:986:26: error[unsupported-operator] Operator `+` is not supported between objects of type `Basic | int | float | complex | Any` and `Literal[1]`
- sympy/functions/combinatorial/factorials.py:986:40: error[unsupported-operator] Operator `+` is not supported between objects of type `Basic` and `Literal[1]`
+ sympy/functions/combinatorial/factorials.py:986:40: error[unsupported-operator] Operator `+` is not supported between objects of type `Basic | int | float | complex | Any` and `Literal[1]`
- sympy/functions/combinatorial/factorials.py:986:53: error[unsupported-operator] Operator `-` is not supported between two objects of type `Basic`
+ sympy/functions/combinatorial/factorials.py:986:53: error[unsupported-operator] Operator `-` is not supported between two objects of type `Basic | int | float | complex | Any`
- sympy/geometry/point.py:1295:25: warning[possibly-missing-attribute] Attribute `tolist` may be missing on object of type `MatrixBase | Expr`
+ sympy/geometry/point.py:1295:25: warning[possibly-missing-attribute] Attribute `tolist` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/geometry/polygon.py:1500:12: warning[possibly-missing-attribute] Attribute `is_Number` may be missing on object of type `Basic | int | float | complex | Any`
- sympy/geometry/polygon.py:1501:20: error[invalid-argument-type] Argument to function `as_int` is incorrect: Expected `SupportsIndex`, found `Basic`
+ sympy/geometry/polygon.py:1501:20: error[invalid-argument-type] Argument to function `as_int` is incorrect: Expected `SupportsIndex`, found `Basic | int | float | complex | Any`
- sympy/geometry/polygon.py:1502:16: error[unsupported-operator] Operator `<` is not supported between objects of type `Basic` and `Literal[3]`
+ sympy/geometry/polygon.py:1502:16: error[unsupported-operator] Operator `<` is not supported between objects of type `Basic | int | float | complex | Any` and `Literal[3]`
+ sympy/geometry/polygon.py:1509:40: warning[possibly-missing-attribute] Attribute `is_number` may be missing on object of type `Basic | int | float | complex | Any`
- sympy/integrals/tests/test_heurisch.py:390:26: error[not-subscriptable] Cannot subscript object of type `Expr` with no `__getitem__` method
+ sympy/integrals/tests/test_heurisch.py:389:17: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
- sympy/matrices/decompositions.py:1321:16: warning[possibly-missing-attribute] Attribute `diagonalize` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/decompositions.py:1321:16: warning[possibly-missing-attribute] Attribute `diagonalize` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/decompositions.py:1334:13: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MatrixBase`
- sympy/matrices/decompositions.py:1336:16: warning[possibly-missing-attribute] Attribute `diagonalize` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/decompositions.py:1336:16: warning[possibly-missing-attribute] Attribute `diagonalize` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/decompositions.py:1348:13: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MatrixBase`
- sympy/matrices/decompositions.py:1350:12: error[invalid-return-type] Return type does not match returned value: expected `tuple[Tmat@_singular_value_decomposition, Tmat@_singular_value_decomposition, Tmat@_singular_value_decomposition]`, found `tuple[MatrixBase | Expr | Unknown, MatrixBase, MatrixBase | Expr | Unknown]`
+ sympy/matrices/decompositions.py:1350:12: error[invalid-return-type] Return type does not match returned value: expected `tuple[Tmat@_singular_value_decomposition, Tmat@_singular_value_decomposition, Tmat@_singular_value_decomposition]`, found `tuple[Unknown | MatrixBase, MatrixBase, MatrixBase | Unknown]`
+ sympy/matrices/eigen.py:328:22: error[invalid-argument-type] Argument to bound method `_as_type` is incorrect: Expected `MatrixBase`, found `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Unknown`
- sympy/matrices/eigen.py:1202:37: error[unresolved-attribute] Object of type `T1'return@call_highest_priority | T2'return@call_highest_priority` has no attribute `pow`
+ sympy/matrices/eigen.py:1202:37: error[unresolved-attribute] Object of type `T2'return@call_highest_priority | T1'return@call_highest_priority` has no attribute `pow`
- sympy/matrices/expressions/tests/test_derivatives.py:551:26: error[unsupported-operator] Operator `+` is not supported between two objects of type `MatrixBase | Expr`
+ sympy/matrices/expressions/tests/test_derivatives.py:551:26: error[unsupported-operator] Operator `+` is not supported between two objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/expressions/tests/test_matadd.py:36:12: error[unsupported-operator] Operator `+` is not supported between objects of type `MatrixBase` and `MatrixBase | Expr`
+ sympy/matrices/expressions/tests/test_matadd.py:36:12: error[unsupported-operator] Operator `+` is not supported between objects of type `MatrixBase` and `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/expressions/tests/test_matmul.py:158:68: warning[possibly-missing-attribute] Attribute `as_explicit` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/expressions/tests/test_matmul.py:158:68: warning[possibly-missing-attribute] Attribute `as_explicit` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/expressions/tests/test_matpow.py:123:46: error[unsupported-operator] Operator `**` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `Literal[2]`
- sympy/matrices/expressions/tests/test_permutation.py:27:12: warning[possibly-missing-attribute] Attribute `as_explicit` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/expressions/tests/test_permutation.py:27:12: warning[possibly-missing-attribute] Attribute `as_explicit` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/inverse.py:385:11: error[unsupported-operator] Operator `-` is not supported between objects of type `MatrixBase` and `MatrixBase | Expr | Unknown`
+ sympy/matrices/inverse.py:384:11: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MatrixBase`
+ sympy/matrices/inverse.py:392:11: error[unsupported-operator] Unary operator `-` is not supported for object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/inverse.py:393:11: error[unsupported-operator] Operator `+` is not supported between objects of type `MatrixBase` and `MatrixBase | Expr | Unknown`
+ sympy/matrices/inverse.py:393:19: error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MatrixBase | Expr`
+ sympy/matrices/inverse.py:393:22: error[unsupported-operator] Unary operator `-` is not supported for object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/matrixbase.py:2957:16: error[invalid-return-type] Return type does not match returned value: expected `Self@_eval_pow_by_cayley`, found `Self@_eval_pow_by_cayley | T1'return@call_highest_priority | T2'return@call_highest_priority`
+ sympy/matrices/matrixbase.py:2957:16: error[invalid-return-type] Return type does not match returned value: expected `Self@_eval_pow_by_cayley`, found `Self@_eval_pow_by_cayley | T2'return@call_highest_priority | T1'return@call_highest_priority`
- sympy/matrices/matrixbase.py:3046:5: error[invalid-argument-type] Argument is incorrect: Expected `(MatrixBase, MatrixBase | Expr, /) -> MatrixBase | Expr`, found `Overload[[Self](self, other: Self) -> Self, (self, other: MatrixBase) -> MatrixBase, (self, other: Expr) -> MatrixBase]`
+ sympy/matrices/matrixbase.py:3046:5: error[invalid-argument-type] Argument is incorrect: Expected `(T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr, T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr, /) -> T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`, found `Overload[[Self](self, other: Self) -> Self, (self, other: MatrixBase) -> MatrixBase, (self, other: Expr) -> MatrixBase]`
- sympy/matrices/matrixbase.py:3256:16: error[invalid-return-type] Return type does not match returned value: expected `MatrixBase`, found `T1'return@call_highest_priority | T2'return@call_highest_priority`
+ sympy/matrices/matrixbase.py:3256:16: error[invalid-return-type] Return type does not match returned value: expected `MatrixBase`, found `T2'return@call_highest_priority | T1'return@call_highest_priority`
- sympy/matrices/matrixbase.py:3256:29: error[invalid-argument-type] Argument is incorrect: Expected `T1'return@call_highest_priority | T2'return@call_highest_priority`, found `MatrixBase`
+ sympy/matrices/matrixbase.py:3256:29: error[invalid-argument-type] Argument is incorrect: Expected `T2'return@call_highest_priority | T1'return@call_highest_priority`, found `MatrixBase`
+ sympy/matrices/matrixbase.py:3944:39: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/matrixbase.py:3944:39: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
- sympy/matrices/matrixbase.py:4640:16: error[invalid-return-type] Return type does not match returned value: expected `Self@D`, found `MatrixBase | Expr`
+ sympy/matrices/matrixbase.py:4640:16: error[invalid-return-type] Return type does not match returned value: expected `Self@D`, found `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/matrixbase.py:4748:16: error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/matrixbase.py:4748:16: error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
- sympy/matrices/matrixbase.py:4923:16: error[invalid-return-type] Return type does not match returned value: expected `Self@analytic_func`, found `Self@analytic_func | T1'return@call_highest_priority | T2'return@call_highest_priority`
+ sympy/matrices/matrixbase.py:4923:16: error[invalid-return-type] Return type does not match returned value: expected `Self@analytic_func`, found `Self@analytic_func | T2'return@call_highest_priority | T1'return@call_highest_priority`
- sympy/matrices/matrixbase.py:5078:16: error[invalid-return-type] Return type does not match returned value: expected `Self@log`, found `MatrixBase | @Todo | Expr`
+ sympy/matrices/matrixbase.py:5076:19: error[unsupported-operator] Operator `*` is not supported between objects of type `@Todo | T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `@Todo | Self@log`
+ sympy/matrices/solvers.py:637:27: error[invalid-argument-type] Argument to bound method `vstack` is incorrect: Argument type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Unknown` does not satisfy upper bound `MatrixBase` of type variable `Self`
+ sympy/matrices/solvers.py:637:27: error[invalid-argument-type] Argument to bound method `vstack` is incorrect: Expected `Tmat@_gauss_jordan_solve`, found `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Unknown`
- sympy/matrices/solvers.py:976:16: warning[possibly-missing-attribute] Attribute `solve` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/solvers.py:976:16: warning[possibly-missing-attribute] Attribute `solve` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/solvers.py:976:30: error[invalid-argument-type] Argument to bound method `solve` is incorrect: Argument type `MatrixBase | Expr` does not satisfy upper bound `MatrixBase` of type variable `Self`
+ sympy/matrices/solvers.py:976:30: error[invalid-argument-type] Argument to bound method `solve` is incorrect: Argument type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` does not satisfy upper bound `MatrixBase` of type variable `Self`
- sympy/matrices/solvers.py:976:30: error[invalid-argument-type] Argument to bound method `solve` is incorrect: Expected `MatrixBase`, found `MatrixBase | Expr`
+ sympy/matrices/solvers.py:976:30: error[invalid-argument-type] Argument to bound method `solve` is incorrect: Expected `MatrixBase`, found `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/sparse.py:417:16: warning[possibly-missing-attribute] Attribute `inv` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/sparse.py:417:16: warning[possibly-missing-attribute] Attribute `inv` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_decompositions.py:23:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/tests/test_decompositions.py:23:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_decompositions.py:32:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/tests/test_decompositions.py:32:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_decompositions.py:42:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `MatrixBase | Expr`
+ sympy/matrices/tests/test_decompositions.py:42:12: warning[possibly-missing-attrib

... (truncated 1871 lines) ...

No memory usage changes detected ✅

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 2, 2026

CodSpeed Performance Report

Merging this PR will degrade performance by 8.31%

Comparing charlie/protocol-property-check (8c30db9) with main (e84b0f4)

Summary

❌ 2 regressed benchmarks
✅ 22 untouched benchmarks
⏩ 30 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime colour_science 93.4 s 98.4 s -5.09%
Simulation DateType 231.6 ms 252.5 ms -8.31%

Footnotes

  1. 30 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@charliermarsh charliermarsh force-pushed the charlie/protocol-property-check branch 4 times, most recently from 4b88a0c to 4a0fe00 Compare February 2, 2026 06:34
@AlexWaygood
Copy link
Member

Thanks for picking this up!! FWIW I'd expect a regression here, because we're doing a fair bit more work than we were before (though obviously we should try to keep it to a minimum).

IIRC, the remaining things I had on my todo list for this PR were:

  • rebase on main ✅️
  • see what, if anything, could be pulled out into standalone PRs
  • generally look through it all again and see if anything could be cleaned up
  • check through the ecosystem results to see if anything looked unexpected
  • writeup a proper PR summary

@charliermarsh
Copy link
Member Author

Very helpful, thank you! I was trying to limit the changes and omit (e.g.) the cosmetic diagnostic changes from the other PR. I'll see if I can pull those out into separate PRs too.

@charliermarsh
Copy link
Member Author

I believe the rich diagnostics are true positives -- like:

from typing import Protocol, NamedTuple

class EdgeProtocol(Protocol):
    size: int  # Mutable attribute member - can be read AND written

class EdgeNamedTuple(NamedTuple):
    size: int  # Immutable field - can only be read, NOT written

def process(edge: EdgeProtocol) -> None:
    edge.size = 10  # Protocol allows this - it's a mutable attribute

nt = EdgeNamedTuple(size=5)
process(nt)  # Error! NamedTuple fields are immutable
nt.size = 10  # This would fail at runtime: AttributeError

Pyright also flags an error.

@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 4, 2026

ecosystem-analyzer results

Lint rule Added Removed Changed
type-assertion-failure 73 573 195
unsupported-operator 283 0 1
no-matching-overload 186 21 0
invalid-argument-type 30 3 15
unresolved-attribute 1 30 1
invalid-assignment 0 16 3
invalid-return-type 9 8 2
unused-type-ignore-comment 1 6 0
possibly-missing-attribute 4 0 2
not-subscriptable 5 0 0
invalid-method-override 2 0 0
not-iterable 0 1 0
Total 594 658 219

Full report with detailed diff (timing results)

@charliermarsh
Copy link
Member Author

I'm going to hesitantly mark ready for review. My goal here was largely to rebase Alex's work, then iterate on the ecosystem reports to fix any false positives. The ecosystem report largely looks good (at least, I fixed several false positives), though there's clearly a lot of churn in ordering, etc., that's making it a bit hard to wade through.

@charliermarsh charliermarsh marked this pull request as ready for review February 4, 2026 05:45
@sharkdp sharkdp removed their request for review February 4, 2026 09:36
charliermarsh and others added 3 commits February 5, 2026 23:14
Also properly support @classmethod and @staticmethod protocol members
instead of using todo_type!() placeholders.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@charliermarsh charliermarsh force-pushed the charlie/protocol-property-check branch from 4f006e6 to 8c30db9 Compare February 6, 2026 16:33
@carljm
Copy link
Contributor

carljm commented Feb 13, 2026

@AlexWaygood I'm tentatively assigning this to you for review? Let me know if you don't want to be the assigned reviewer.

@carljm carljm removed their request for review February 13, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ecosystem-analyzer ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants