Skip to content

[ty] relax the attribute narrowing condition#22440

Merged
carljm merged 6 commits intoastral-sh:mainfrom
mtshiba:relax-attribute-narrowing
Feb 6, 2026
Merged

[ty] relax the attribute narrowing condition#22440
carljm merged 6 commits intoastral-sh:mainfrom
mtshiba:relax-attribute-narrowing

Conversation

@mtshiba
Copy link
Collaborator

@mtshiba mtshiba commented Jan 7, 2026

Summary

Fixes astral-sh/ty#2134

This PR is based on the "pragmatism" that narrowing should only be disabled when an attribute is a data descriptor, and should be left as is when it might be a data descriptor.

I believe this is somewhat justified given the fact that the current behavior is not strictly safe either.

from typing import Any

class FixedAge:
    def __get__(self, obj, objtype=None):
        return -1

    def __set__(self, obj, value):
        pass

class Person:
    def __init__(self, age):
        self.age = age

class Dead(Person):
    age = FixedAge()

def f(p: Person):
    p.age = 21
    reveal_type(p.age)  # reveals Literal[21], but -1 at runtime

f(Dead(20))

This code doesn't throw an error, and there's nothing inherently unsound about it, but the narrowing result is still incorrect.
Even if the class attribute is Undefined, there is the possibility of dynamic attribute additions or additions in subclasses (and this issue persists even if we don't mark implicit attribute types with Unknown |).
But if we take this into account, this kind of narrowing of implicit attributes becomes completely inapplicable!

I'd like to see the results of mypy_primer and decide whether this idea makes sense.

Test Plan

mdtest updated

@mtshiba mtshiba added the ty Multi-file analysis & type inference label Jan 7, 2026
@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 7, 2026

Typing conformance results

No changes detected ✅

@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 7, 2026

mypy_primer results

Changes were detected when running on open source projects
pip (https://github.com/pypa/pip)
- src/pip/_vendor/distlib/util.py:1484:36: warning[possibly-missing-attribute] Attribute `getpeercert` may be missing on object of type `socket | Any`
+ src/pip/_vendor/distlib/util.py:1484:36: error[invalid-argument-type] Argument to function `match_hostname` is incorrect: Expected `dict[str, str | tuple[tuple[tuple[str, str], ...], ...] | tuple[tuple[str, str], ...]]`, found `dict[str, str | tuple[tuple[tuple[str, str], ...], ...] | tuple[tuple[str, str], ...]] | None`

beartype (https://github.com/beartype/beartype)
+ beartype/_conf/confmain.py:961:17: error[invalid-argument-type] Argument to function `issubclass` is incorrect: Expected `type`, found `BeartypeDecorPlace | bool | Collection[str] | ... omitted 5 union elements`
+ beartype/_conf/confmain.py:963:17: error[invalid-argument-type] Argument to function `issubclass` is incorrect: Expected `type`, found `BeartypeDecorPlace | bool | Collection[str] | ... omitted 5 union elements`
+ beartype/_conf/confmain.py:965:17: error[invalid-argument-type] Argument to function `issubclass` is incorrect: Expected `type`, found `BeartypeDecorPlace | bool | Collection[str] | ... omitted 5 union elements`
- Found 514 diagnostics
+ Found 517 diagnostics

alerta (https://github.com/alerta/alerta)
+ alerta/auth/decorators.py:51:54: error[invalid-argument-type] Argument to bound method `is_in_scope` is incorrect: Expected `list[Scope]`, found `Unknown | (list[str] & ~AlwaysFalsy) | list[Unknown | Scope]`
- Found 620 diagnostics
+ Found 621 diagnostics

paasta (https://github.com/yelp/paasta)
+ paasta_tools/kubernetes_tools.py:609:42: error[call-non-callable] Object of type `property` is not callable
- Found 1073 diagnostics
+ Found 1074 diagnostics

ignite (https://github.com/pytorch/ignite)
- ignite/engine/engine.py:810:33: error[no-matching-overload] No overload of function `iter` matches arguments
- ignite/engine/engine.py:1119:63: error[unsupported-operator] Operator `/` is not supported between objects of type `(Unknown & ~None) | int` and `Unknown | int | None`
- ignite/engine/engine.py:1306:63: error[unsupported-operator] Operator `/` is not supported between objects of type `(Unknown & ~None) | int` and `Unknown | int | None`
+ tests/ignite/handlers/test_clearml_logger.py:287:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_clearml_logger.py:301:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_clearml_logger.py:310:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_clearml_logger.py:327:5: error[unresolved-attribute] Unresolved attribute `alpha` on type `State`
+ tests/ignite/handlers/test_clearml_logger.py:328:5: error[unresolved-attribute] Unresolved attribute `beta` on type `State`
+ tests/ignite/handlers/test_clearml_logger.py:329:5: error[unresolved-attribute] Unresolved attribute `gamma` on type `State`
+ tests/ignite/handlers/test_mlflow_logger.py:173:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_mlflow_logger.py:187:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_mlflow_logger.py:196:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_mlflow_logger.py:213:5: error[unresolved-attribute] Unresolved attribute `alpha` on type `State`
+ tests/ignite/handlers/test_mlflow_logger.py:214:5: error[unresolved-attribute] Unresolved attribute `beta` on type `State`
+ tests/ignite/handlers/test_mlflow_logger.py:215:5: error[unresolved-attribute] Unresolved attribute `gamma` on type `State`
+ tests/ignite/handlers/test_neptune_logger.py:257:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_neptune_logger.py:272:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_neptune_logger.py:278:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_neptune_logger.py:319:5: error[unresolved-attribute] Unresolved attribute `alpha` on type `State`
+ tests/ignite/handlers/test_neptune_logger.py:320:5: error[unresolved-attribute] Unresolved attribute `beta` on type `State`
+ tests/ignite/handlers/test_neptune_logger.py:321:5: error[unresolved-attribute] Unresolved attribute `gamma` on type `State`
+ tests/ignite/handlers/test_polyaxon_logger.py:195:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_polyaxon_logger.py:209:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_polyaxon_logger.py:218:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_polyaxon_logger.py:235:5: error[unresolved-attribute] Unresolved attribute `alpha` on type `State`
+ tests/ignite/handlers/test_polyaxon_logger.py:236:5: error[unresolved-attribute] Unresolved attribute `beta` on type `State`
+ tests/ignite/handlers/test_polyaxon_logger.py:237:5: error[unresolved-attribute] Unresolved attribute `gamma` on type `State`
+ tests/ignite/handlers/test_tensorboard_logger.py:243:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_tensorboard_logger.py:257:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_tensorboard_logger.py:266:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_visdom_logger.py:479:5: error[unresolved-attribute] Unresolved attribute `alpha` on type `State`
+ tests/ignite/handlers/test_visdom_logger.py:480:5: error[unresolved-attribute] Unresolved attribute `beta` on type `State`
+ tests/ignite/handlers/test_visdom_logger.py:481:5: error[unresolved-attribute] Unresolved attribute `gamma` on type `State`
+ tests/ignite/handlers/test_visdom_logger.py:597:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_visdom_logger.py:612:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_visdom_logger.py:633:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_wandb_logger.py:216:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_wandb_logger.py:230:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_wandb_logger.py:238:5: error[invalid-assignment] Object of type `float` is not assignable to attribute `output` of type `int | None`
+ tests/ignite/handlers/test_wandb_logger.py:255:5: error[unresolved-attribute] Unresolved attribute `alpha` on type `State`
+ tests/ignite/handlers/test_wandb_logger.py:256:5: error[unresolved-attribute] Unresolved attribute `beta` on type `State`
+ tests/ignite/handlers/test_wandb_logger.py:257:5: error[unresolved-attribute] Unresolved attribute `gamma` on type `State`
+ tests/ignite/handlers/test_wandb_logger.py:258:5: error[unresolved-attribute] Unresolved attribute `delta` on type `State`
- Found 2036 diagnostics
+ Found 2073 diagnostics

dragonchain (https://github.com/dragonchain/dragonchain)
- dragonchain/job_processor/contract_job_utest.py:146:26: error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- dragonchain/job_processor/contract_job_utest.py:147:26: error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- dragonchain/job_processor/contract_job_utest.py:148:26: error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- dragonchain/job_processor/contract_job_utest.py:149:26: error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- dragonchain/job_processor/contract_job_utest.py:431:9: warning[possibly-missing-attribute] Attribute `update` may be missing on object of type `Unknown | None | (Divergent & ~AlwaysFalsy)`
- dragonchain/job_processor/contract_job_utest.py:435:9: error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `save` on type `Unknown | SmartContractModel`
- Found 434 diagnostics
+ Found 428 diagnostics

urllib3 (https://github.com/urllib3/urllib3)
- test/test_http2_connection.py:133:9: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `socket | Any | SSLTransport | None`
- test/test_http2_connection.py:133:9: warning[possibly-missing-attribute] Attribute `assert_called_with` may be missing on object of type `(bound method socket.sendall(data: Buffer, flags: int = 0, /) -> None) | Any | (bound method SSLTransport.sendall(data: bytes, flags: int = 0) -> None)`
- test/test_http2_connection.py:150:9: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `socket | Any | SSLTransport | None`
- test/test_http2_connection.py:150:9: warning[possibly-missing-attribute] Attribute `assert_called_with` may be missing on object of type `(bound method socket.sendall(data: Buffer, flags: int = 0, /) -> None) | Any | (bound method SSLTransport.sendall(data: bytes, flags: int = 0) -> None)`
- test/test_http2_connection.py:173:9: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `socket | Any | SSLTransport | None`
- test/test_http2_connection.py:173:9: warning[possibly-missing-attribute] Attribute `assert_has_calls` may be missing on object of type `(bound method socket.sendall(data: Buffer, flags: int = 0, /) -> None) | Any | (bound method SSLTransport.sendall(data: bytes, flags: int = 0) -> None)`
- test/test_http2_connection.py:205:17: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `socket | Any | SSLTransport | None`
- test/test_http2_connection.py:205:17: warning[possibly-missing-attribute] Attribute `assert_called_with` may be missing on object of type `(bound method socket.sendall(data: Buffer, flags: int = 0, /) -> None) | Any | (bound method SSLTransport.sendall(data: bytes, flags: int = 0) -> None)`
- test/test_http2_connection.py:229:13: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `socket | Any | SSLTransport | None`
- test/test_http2_connection.py:229:13: warning[possibly-missing-attribute] Attribute `assert_called_with` may be missing on object of type `(bound method socket.sendall(data: Buffer, flags: int = 0, /) -> None) | Any | (bound method SSLTransport.sendall(data: bytes, flags: int = 0) -> None)`
- test/test_http2_connection.py:246:19: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `socket | Any | SSLTransport | None`
- test/test_http2_connection.py:259:9: warning[possibly-missing-attribute] Attribute `assert_called_with` may be missing on object of type `(bound method socket.sendall(data: Buffer, flags: int = 0, /) -> None) | Any | (bound method SSLTransport.sendall(data: bytes, flags: int = 0) -> None)`
- test/test_http2_connection.py:279:19: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `socket | Any | SSLTransport | None`
- test/test_http2_connection.py:292:9: warning[possibly-missing-attribute] Attribute `assert_called_with` may be missing on object of type `(bound method socket.sendall(data: Buffer, flags: int = 0, /) -> None) | Any | (bound method SSLTransport.sendall(data: bytes, flags: int = 0) -> None)`
- test/test_http2_connection.py:312:19: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `socket | Any | SSLTransport | None`
- test/test_http2_connection.py:325:9: warning[possibly-missing-attribute] Attribute `assert_called_with` may be missing on object of type `(bound method socket.sendall(data: Buffer, flags: int = 0, /) -> None) | Any | (bound method SSLTransport.sendall(data: bytes, flags: int = 0) -> None)`
- test/test_http2_connection.py:334:19: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `socket | Any | SSLTransport | None`
- test/test_http2_connection.py:347:9: warning[possibly-missing-attribute] Attribute `assert_called_with` may be missing on object of type `(bound method socket.sendall(data: Buffer, flags: int = 0, /) -> None) | Any | (bound method SSLTransport.sendall(data: bytes, flags: int = 0) -> None)`
- Found 303 diagnostics
+ Found 285 diagnostics

vision (https://github.com/pytorch/vision)
- torchvision/datasets/cityscapes.py:152:65: warning[possibly-unresolved-reference] Name `target_dir_zip` used when possibly not defined
- torchvision/datasets/cityscapes.py:154:43: warning[possibly-unresolved-reference] Name `target_dir_zip` used when possibly not defined
- torchvision/datasets/stl10.py:78:27: error[no-matching-overload] No overload of function `concatenate` matches arguments
- Found 1393 diagnostics
+ Found 1390 diagnostics

artigraph (https://github.com/artigraph/artigraph)
+ tests/arti/graphs/test_graph.py:30:12: error[unresolved-attribute] Object of type `Literal[5]` has no attribute `storage`
+ tests/arti/graphs/test_graph.py:31:12: error[unresolved-attribute] Object of type `Storage[Unknown]` has no attribute `id`
- Found 144 diagnostics
+ Found 146 diagnostics

cki-lib (https://gitlab.com/cki-project/cki-lib)
- tests/test_cronjob.py:43:9: warning[possibly-missing-attribute] Attribute `assert_has_calls` may be missing on object of type `Unknown | Event`
- Found 241 diagnostics
+ Found 240 diagnostics

discord.py (https://github.com/Rapptz/discord.py)
+ discord/ext/commands/cog.py:335:27: error[unresolved-attribute] Object of type `(...) -> Coroutine[Any, Any, Any]` has no attribute `__name__`
- discord/ext/commands/cog.py:339:57: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- discord/ext/commands/cog.py:349:56: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- discord/ext/commands/cog.py:352:54: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- discord/ext/commands/cog.py:353:46: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- discord/ext/commands/cog.py:363:56: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- Found 535 diagnostics
+ Found 531 diagnostics

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
- bson/code.py:78:46: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- pymongo/asynchronous/cursor.py:120:13: error[invalid-assignment] Object of type `Literal[True]` is not assignable to attribute `_attached_to_cursor` on type `AsyncClientSession | None`
- pymongo/synchronous/cursor.py:120:13: error[invalid-assignment] Object of type `Literal[True]` is not assignable to attribute `_attached_to_cursor` on type `ClientSession | None`
- Found 446 diagnostics
+ Found 443 diagnostics

cloud-init (https://github.com/canonical/cloud-init)
- cloudinit/sources/DataSourceLXD.py:119:9: warning[possibly-missing-attribute] Attribute `connect` may be missing on object of type `socket | Any | None`
+ tests/unittests/sources/test_oracle.py:1637:13: error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `Unknown | int | list[Unknown | dict[Unknown | str, Unknown | str | list[Unknown | dict[Unknown | str, Unknown | str | list[Unknown | str]]]]]`
- tests/unittests/test_stages.py:226:9: error[invalid-assignment] Object of type `list[Unknown | NetworkConfigSource]` is not assignable to attribute `network_config_sources` on type `Unknown | DataSource | None`
+ tests/unittests/test_stages.py:226:9: error[invalid-assignment] Object of type `list[Unknown | NetworkConfigSource]` is not assignable to attribute `network_config_sources` of type `tuple[NetworkConfigSource, ...]`
- tests/unittests/test_stages.py:252:9: error[invalid-assignment] Object of type `list[Unknown | str | NetworkConfigSource]` is not assignable to attribute `network_config_sources` on type `Unknown | DataSource | None`
+ tests/unittests/test_stages.py:252:9: error[invalid-assignment] Object of type `list[Unknown | str | NetworkConfigSource]` is not assignable to attribute `network_config_sources` of type `tuple[NetworkConfigSource, ...]`
- tests/unittests/test_stages.py:281:9: error[invalid-assignment] Object of type `list[Unknown | NetworkConfigSource]` is not assignable to attribute `network_config_sources` on type `Unknown | DataSource | None`
+ tests/unittests/test_stages.py:281:9: error[invalid-assignment] Object of type `list[Unknown | NetworkConfigSource]` is not assignable to attribute `network_config_sources` of type `tuple[NetworkConfigSource, ...]`

pyodide (https://github.com/pyodide/pyodide)
+ src/tests/test_jsproxy.py:324:12: error[missing-argument] No argument provided for required parameter `self` of function `f`
- Found 939 diagnostics
+ Found 940 diagnostics

apprise (https://github.com/caronc/apprise)
+ tests/test_apprise_cli.py:130:9: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_apprise_cli.py:1879:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_escapes.py:44:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_logger.py:371:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_dapnet.py:192:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_dapnet.py:246:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_discord.py:308:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_discord.py:523:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_discord.py:524:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_discord.py:614:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_discord.py:621:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_discord.py:871:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_discord.py:927:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_discord.py:1112:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_discord.py:1141:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_discord.py:1165:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:149:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:150:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:150:37: error[unresolved-attribute] Object of type `Request` has no attribute `content`
+ tests/test_plugin_emby.py:153:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:154:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:158:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:159:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:162:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:163:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:164:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:164:37: error[unresolved-attribute] Object of type `Request` has no attribute `content`
+ tests/test_plugin_emby.py:203:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:204:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:204:37: error[unresolved-attribute] Object of type `Request` has no attribute `content`
+ tests/test_plugin_emby.py:207:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:208:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:212:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:213:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:216:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:217:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:240:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:243:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:243:37: error[unresolved-attribute] Object of type `Request` has no attribute `content`
+ tests/test_plugin_emby.py:254:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:261:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:261:37: error[unresolved-attribute] Object of type `Request` has no attribute `content`
+ tests/test_plugin_emby.py:274:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:280:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:280:37: error[unresolved-attribute] Object of type `Request` has no attribute `content`
+ tests/test_plugin_emby.py:322:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:323:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:323:37: error[unresolved-attribute] Object of type `Request` has no attribute `content`
+ tests/test_plugin_emby.py:326:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:327:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:333:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:334:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:339:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:340:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:341:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:341:37: error[unresolved-attribute] Object of type `Request` has no attribute `content`
+ tests/test_plugin_emby.py:351:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:362:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:362:37: error[unresolved-attribute] Object of type `Request` has no attribute `content`
+ tests/test_plugin_emby.py:413:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:414:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:414:37: error[unresolved-attribute] Object of type `Request` has no attribute `content`
+ tests/test_plugin_emby.py:417:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:418:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:424:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:425:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:430:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:431:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_emby.py:432:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_emby.py:432:37: error[unresolved-attribute] Object of type `Request` has no attribute `content`
+ tests/test_plugin_google_chat.py:173:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_gotify.py:191:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_guilded.py:212:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_ifttt.py:163:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_ifttt.py:164:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_ifttt.py:165:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_ifttt.py:166:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_join.py:246:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_mattermost.py:211:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_msteams.py:248:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_ntfy.py:663:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_ntfy.py:665:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_onesignal.py:354:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_opsgenie.py:415:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_opsgenie.py:416:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_opsgenie.py:458:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_opsgenie.py:459:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_pagertree.py:172:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_prowl.py:220:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_pushbullet.py:430:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_pushbullet.py:431:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_pushed.py:219:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_pushed.py:220:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_pushed.py:271:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_pushed.py:272:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_pushover.py:416:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_pushover.py:495:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_pushsafer.py:301:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_pushsafer.py:302:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_revolt.py:276:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_revolt.py:277:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_revolt.py:358:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_revolt.py:359:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_revolt.py:430:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_revolt.py:437:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_revolt.py:484:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_revolt.py:485:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_revolt.py:542:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_revolt.py:543:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_rocket_chat.py:348:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_rocket_chat.py:349:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_rocket_chat.py:350:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_rocket_chat.py:351:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_rocket_chat.py:369:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_rocket_chat.py:370:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_rocket_chat.py:374:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_rocket_chat.py:375:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_rocket_chat.py:376:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_rocket_chat.py:377:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_rocket_chat.py:394:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_rocket_chat.py:395:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_signal.py:56:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_signal.py:57:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_slack.py:664:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_slack.py:665:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_slack.py:666:5: error[unresolved-attribute] Unresolved attribute `text` on type `Request`
+ tests/test_plugin_telegram.py:382:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_telegram.py:383:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_telegram.py:390:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_telegram.py:395:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_telegram.py:400:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_telegram.py:423:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_telegram.py:762:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_telegram.py:763:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_telegram.py:766:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_telegram.py:795:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_telegram.py:1310:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_telegram.py:1313:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_telegram.py:1420:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_telegram.py:1423:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_telegram.py:1527:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_telegram.py:1530:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_title_maxlen.py:52:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_title_maxlen.py:53:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_twist.py:190:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_twist.py:191:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_twist.py:192:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_twist.py:196:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_twist.py:196:37: error[unresolved-attribute] Object of type `Request` has no attribute `content`
+ tests/test_plugin_twist.py:211:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_twist.py:221:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_twist.py:221:37: error[unresolved-attribute] Object of type `Request` has no attribute `content`
+ tests/test_plugin_twist.py:230:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_twist.py:240:5: error[unresolved-attribute] Unresolved attribute `content` on type `Request`
+ tests/test_plugin_twist.py:240:37: error[unresolved-attribute] Object of type `Request` has no attribute `content`
+ tests/test_plugin_twist.py:249:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_twist.py:250:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_twist.py:254:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_twist.py:255:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_twist.py:263:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_twist.py:264:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
+ tests/test_plugin_workflows.py:235:5: error[unresolved-attribute] Unresolved attribute `status_code` on type `Request`
- Found 2886 diagnostics
+ Found 3048 diagnostics

dd-trace-py (https://github.com/DataDog/dd-trace-py)
- tests/integration/test_integration_civisibility.py:92:9: error[invalid-assignment] Object of type `Unknown` is not assignable to attribute `_conn` on type `Unknown | TraceWriter`
- tests/integration/test_integration_civisibility.py:105:20: warning[possibly-missing-attribute] Attribute `_conn` may be missing on object of type `Unknown | TraceWriter`
- Found 9164 diagnostics
+ Found 9162 diagnostics

AutoSplit (https://github.com/Toufool/AutoSplit)
- src/AutoSplit.py:182:13: warning[possibly-missing-attribute] Attribute `start` may be missing on object of type `AutoControlledThread | None`
- Found 34 diagnostics
+ Found 33 diagnostics

streamlit (https://github.com/streamlit/streamlit)
+ lib/streamlit/elements/widgets/slider.py:1014:66: error[invalid-argument-type] Argument to bound method `deserialize_single_value` is incorrect: Expected `int | float`, found `Any | int | float | date | time`
+ lib/streamlit/elements/widgets/slider.py:1019:66: error[invalid-argument-type] Argument to bound method `deserialize_single_value` is incorrect: Expected `int | float`, found `Any | int | float | date | time`
- Found 98 diagnostics
+ Found 100 diagnostics

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

jax (https://github.com/google/jax)
- jax/_src/distributed.py:167:5: warning[possibly-missing-attribute] Attribute `connect` may be missing on object of type `DistributedRuntimeClient | Any | None`
- jax/_src/distributed.py:211:5: warning[possibly-missing-attribute] Attribute `initialize` may be missing on object of type `Any | None`
+ jax/_src/distributed.py:211:45: error[invalid-argument-type] Argument to bound method `initialize` is incorrect: Expected `DistributedRuntimeClient`, found `DistributedRuntimeClient | Any | None`
- Found 3022 diagnostics
+ Found 3021 diagnostics

pandas (https://github.com/pandas-dev/pandas)
+ pandas/tests/series/accessors/test_dt_accessor.py:289:13: error[invalid-assignment] Cannot assign to a subscript on an object of type `Literal[5]`
- Found 4436 diagnostics
+ Found 4437 diagnostics

sympy (https://github.com/sympy/sympy)
+ 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/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/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/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: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: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: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] A

... (truncated 330 lines) ...

No memory usage changes detected ✅

@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 7, 2026

ecosystem-analyzer results

Lint rule Added Removed Changed
unresolved-attribute 187 20 0
unsupported-operator 3 86 50
not-subscriptable 1 100 0
possibly-missing-attribute 26 33 35
invalid-assignment 22 4 5
invalid-argument-type 16 5 9
no-matching-overload 21 2 0
unused-type-ignore-comment 3 6 0
invalid-parameter-default 0 0 7
invalid-return-type 1 1 2
not-iterable 0 0 2
possibly-unresolved-reference 0 2 0
call-non-callable 1 0 0
missing-argument 1 0 0
Total 282 259 110

Full report with detailed diff (timing results)

@mtshiba mtshiba force-pushed the relax-attribute-narrowing branch from b6d09c3 to 8238ad4 Compare January 7, 2026 16:48
@mtshiba
Copy link
Collaborator Author

mtshiba commented Jan 7, 2026

The mypy_primer results look reasonable.
The newly added errors are due to dynamically patching attributes that don't exist in the original class.

@mtshiba mtshiba marked this pull request as ready for review January 7, 2026 17:03
@AlexWaygood AlexWaygood removed their request for review January 13, 2026 21:34
@sharkdp sharkdp self-assigned this Feb 3, 2026
Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! The logic here looks solid. Some suggested renamings (or non-renamings) and comment updates. One question I don't quite understand about why the existing exception for Unknown wasn't effective.

@carljm
Copy link
Contributor

carljm commented Feb 4, 2026

Have you done any analysis of the ecosystem results here?

@sharkdp sharkdp removed their assignment Feb 4, 2026
@mtshiba
Copy link
Collaborator Author

mtshiba commented Feb 5, 2026

Have you done any analysis of the ecosystem results here?

The latest results show that this PR has removed many more false positive errors.
From what I can see, many of the removed errors were due to narrowing not working correctly.

Many of the newly added errors are caused by dynamically adding attributes to objects.

@carljm
Copy link
Contributor

carljm commented Feb 6, 2026

Looks great!

BTW if your PR is reviewed with a green checkmark (approved), you should feel free to merge it yourself after addressing any comments, unless you feel there is something in the comments that needs more discussion, or the changes are large and you want re-review (then you can request re-review).

@carljm carljm merged commit 76d9cd4 into astral-sh:main Feb 6, 2026
49 checks passed
@mtshiba mtshiba deleted the relax-attribute-narrowing branch February 6, 2026 03:02
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.

Support deeper-nested attribute type narrowing

3 participants