Skip to content

Comments

[ty] Bind typing.Self in class attributes and assignment#22487

Closed
charliermarsh wants to merge 11 commits intomainfrom
charlie/self
Closed

[ty] Bind typing.Self in class attributes and assignment#22487
charliermarsh wants to merge 11 commits intomainfrom
charlie/self

Conversation

@charliermarsh
Copy link
Member

Summary

We now bind typing.Self to its class context so class-body attribute annotations resolve correctly, including dataclass fields and regular instance assignments.

Closes astral-sh/ty#1124.

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

astral-sh-bot bot commented Jan 9, 2026

Typing conformance results improved 🎉

The percentage of diagnostics emitted that were expected errors increased from 77.13% to 77.49%. The percentage of expected errors that received a diagnostic held steady at 59.50%.

Summary

Metric Old New Diff Outcome
True Positives 661 661 +0
False Positives 196 192 -4 ⏬ (✅)
False Negatives 450 450 +0
Total Diagnostics 857 853 -4
Precision 77.13% 77.49% +0.36% ⏫ (✅)
Recall 59.50% 59.50% +0.00%

False positives removed

Details
Location Name Message
generics_self_advanced.py:36:9 type-assertion-failure Type list[Self@method2] does not match asserted type list[<special-form 'typing.Self'>]
generics_self_advanced.py:37:9 type-assertion-failure Type Self@method2 does not match asserted type <special-form 'typing.Self'>
generics_self_attributes.py:29:5 invalid-assignment Object of type OrdinalLinkedList is not assignable to attribute next of type <special-form 'typing.Self'> | None
generics_self_usage.py:50:34 invalid-assignment Object of type def foo(self) -> int is not assignable to (<special-form 'typing.Self'>, /) -> int

@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 9, 2026

mypy_primer results

Changes were detected when running on open source projects
pegen (https://github.com/we-like-parsers/pegen)
- src/pegen/python_generator.py:270:51: error[unresolved-attribute] Object of type `GrammarVisitor` has no attribute `keywords`
- src/pegen/python_generator.py:271:56: error[unresolved-attribute] Object of type `GrammarVisitor` has no attribute `soft_keywords`
- Found 48 diagnostics
+ Found 46 diagnostics

bidict (https://github.com/jab/bidict)
- bidict/_base.py:501:9: error[no-matching-overload] No overload of bound method `update` matches arguments
- Found 16 diagnostics
+ Found 15 diagnostics

anyio (https://github.com/agronholm/anyio)
- src/anyio/_backends/_asyncio.py:838:28: error[unresolved-attribute] Object of type `CancelScope` has no attribute `_effectively_cancelled`
- src/anyio/_backends/_asyncio.py:856:40: error[unresolved-attribute] Object of type `CancelScope` has no attribute `_host_task`
- src/anyio/_backends/_asyncio.py:859:28: error[unresolved-attribute] Object of type `CancelScope` has no attribute `_host_task`
- src/anyio/_backends/_asyncio.py:883:34: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `anyio._backends._asyncio.CancelScope | None`, found `anyio._core._tasks.CancelScope`
- src/anyio/_backends/_asyncio.py:885:9: error[unresolved-attribute] Object of type `CancelScope` has no attribute `_tasks`
- Found 92 diagnostics
+ Found 87 diagnostics

parso (https://github.com/davidhalter/parso)
- parso/python/pep8.py:290:22: warning[possibly-missing-attribute] Attribute `get_latest_suite_node` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:290:22: warning[possibly-missing-attribute] Attribute `get_latest_suite_node` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:385:37: warning[possibly-missing-attribute] Attribute `parent` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:385:37: warning[possibly-missing-attribute] Attribute `parent` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:414:16: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:414:16: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:415:20: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:415:20: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:418:35: warning[possibly-missing-attribute] Attribute `indentation` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:418:35: warning[possibly-missing-attribute] Attribute `indentation` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:419:54: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:419:54: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:431:16: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:431:16: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:433:41: warning[possibly-missing-attribute] Attribute `parent` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:433:41: warning[possibly-missing-attribute] Attribute `parent` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:436:41: warning[possibly-missing-attribute] Attribute `indentation` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:436:41: warning[possibly-missing-attribute] Attribute `indentation` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:460:49: warning[possibly-missing-attribute] Attribute `bracket_indentation` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:460:49: warning[possibly-missing-attribute] Attribute `bracket_indentation` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:462:49: warning[possibly-missing-attribute] Attribute `indentation` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:462:49: warning[possibly-missing-attribute] Attribute `indentation` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:464:29: warning[possibly-missing-attribute] Attribute `get_latest_suite_node` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:464:29: warning[possibly-missing-attribute] Attribute `get_latest_suite_node` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:471:36: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:471:36: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:486:40: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:486:40: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:492:42: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:492:42: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:498:42: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:498:42: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:507:40: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:507:40: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:513:42: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:513:42: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:537:24: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:537:24: warning[possibly-missing-attribute] Attribute `type` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:538:41: warning[possibly-missing-attribute] Attribute `parent` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:538:41: warning[possibly-missing-attribute] Attribute `parent` may be missing on object of type `Unknown | IndentationNode | None`
- parso/python/pep8.py:541:27: warning[possibly-missing-attribute] Attribute `indentation` may be missing on object of type `Unknown | None | IndentationNode`
+ parso/python/pep8.py:541:27: warning[possibly-missing-attribute] Attribute `indentation` may be missing on object of type `Unknown | IndentationNode | None`

spack (https://github.com/spack/spack)
- lib/spack/spack/installer.py:1309:27: error[invalid-argument-type] Argument to bound method `__call__` is incorrect: Expected `str | bytes | PathLike[str] | PathLike[bytes]`, found `Unknown | None | str`
- lib/spack/spack/installer.py:1322:23: error[invalid-argument-type] Argument to function `rename` is incorrect: Expected `str | bytes | PathLike[str] | PathLike[bytes]`, found `Unknown | None | str`
- lib/spack/spack/util/s3.py:143:16: warning[possibly-missing-attribute] Attribute `read` may be missing on object of type `_BufferedReaderStream | Unknown | None`
+ lib/spack/spack/util/s3.py:143:16: warning[possibly-missing-attribute] Attribute `read` may be missing on object of type `Unknown | None`
- Found 4337 diagnostics
+ Found 4335 diagnostics

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: warning[possibly-missing-attribute] Attribute `getpeercert` may be missing on object of type `Unknown | socket`
- src/pip/_vendor/urllib3/poolmanager.py:508:13: warning[possibly-missing-attribute] Attribute `host` may be missing on object of type `Unknown | None`
- src/pip/_vendor/urllib3/poolmanager.py:508:30: warning[possibly-missing-attribute] Attribute `port` may be missing on object of type `Unknown | None`
- src/pip/_vendor/urllib3/poolmanager.py:508:47: warning[possibly-missing-attribute] Attribute `scheme` may be missing on object of type `Unknown | None`
- Found 594 diagnostics
+ Found 591 diagnostics

bandersnatch (https://github.com/pypa/bandersnatch)
- src/bandersnatch/mirror.py:264:13: error[invalid-argument-type] Argument to function `max` is incorrect: Argument type `Unknown | int | None` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
- src/bandersnatch/mirror.py:353:52: error[invalid-argument-type] Argument to bound method `sync_index_page` is incorrect: Expected `int`, found `int | None`
- Found 78 diagnostics
+ Found 76 diagnostics

werkzeug (https://github.com/pallets/werkzeug)
- src/werkzeug/datastructures/mixins.py:238:28: error[invalid-argument-type] Argument is incorrect: Expected `<special-form 'typing.Self'>`, found `UpdateDictMixin[Any, Any]`
- src/werkzeug/datastructures/mixins.py:262:28: error[invalid-argument-type] Argument is incorrect: Expected `<special-form 'typing.Self'>`, found `Self@setdefault`
- src/werkzeug/datastructures/mixins.py:282:28: error[invalid-argument-type] Argument is incorrect: Expected `<special-form 'typing.Self'>`, found `Self@pop`
- src/werkzeug/datastructures/structures.py:1053:9: error[invalid-assignment] Object of type `((Self@__init__, /) -> None) | None` is not assignable to attribute `on_update` of type `((<special-form 'typing.Self'>, /) -> None) | None`
+ src/werkzeug/datastructures/structures.py:1053:9: error[invalid-assignment] Object of type `((Self@__init__, /) -> None) | None` is not assignable to attribute `on_update` of type `((CallbackDict[Unknown, Unknown], /) -> None) | None`
- src/werkzeug/datastructures/structures.py:1104:28: error[invalid-argument-type] Argument is incorrect: Expected `Self@__init__`, found `Self@remove`
- src/werkzeug/datastructures/structures.py:1119:28: error[invalid-argument-type] Argument is incorrect: Expected `Self@__init__`, found `Self@update`
- src/werkzeug/datastructures/structures.py:1159:28: error[invalid-argument-type] Argument is incorrect: Expected `Self@__init__`, found `Self@clear`
- src/werkzeug/datastructures/structures.py:1185:28: error[invalid-argument-type] Argument is incorrect: Expected `Self@__init__`, found `Self@__delitem__`
- src/werkzeug/datastructures/structures.py:1193:28: error[invalid-argument-type] Argument is incorrect: Expected `Self@__init__`, found `Self@__setitem__`
- Found 407 diagnostics
+ Found 399 diagnostics

stone (https://github.com/dropbox/stone)
- stone/backends/js_client.py:167:27: warning[possibly-missing-attribute] Attribute `name` may be missing on object of type `Unknown | None`
- stone/backends/js_client.py:170:29: warning[possibly-missing-attribute] Attribute `name` may be missing on object of type `Unknown | None`
- stone/backends/python_types.py:210:24: warning[possibly-missing-attribute] Attribute `name` may be missing on object of type `Unknown | None`
- Found 252 diagnostics
+ Found 249 diagnostics

aiortc (https://github.com/aiortc/aiortc)
- src/aiortc/rtcpeerconnection.py:571:25: warning[possibly-missing-attribute] Attribute `media` may be missing on object of type `SessionDescription | None | @Todo`
- src/aiortc/rtcpeerconnection.py:575:21: error[invalid-argument-type] Argument to function `create_media_description_for_transceiver` is incorrect: Expected `RTCRtpTransceiver`, found `RTCRtpTransceiver | None | @Todo`
- src/aiortc/rtcpeerconnection.py:578:25: warning[possibly-missing-attribute] Attribute `direction` may be missing on object of type `RTCRtpTransceiver | None | @Todo`
- src/aiortc/rtcpeerconnection.py:578:48: error[invalid-argument-type] Argument to function `and_direction` is incorrect: Expected `str`, found `str | None | @Todo`
- src/aiortc/rtcpeerconnection.py:578:48: warning[possibly-missing-attribute] Attribute `_offerDirection` may be missing on object of type `RTCRtpTransceiver | None | @Todo`
- src/aiortc/rtcpeerconnection.py:580:21: error[invalid-argument-type] Argument to function `create_media_description_for_transceiver` is incorrect: Expected `str`, found `str | None | @Todo`
- src/aiortc/rtcpeerconnection.py:580:25: warning[possibly-missing-attribute] Attribute `mid` may be missing on object of type `RTCRtpTransceiver | None | @Todo`
- src/aiortc/rtcpeerconnection.py:582:33: warning[possibly-missing-attribute] Attribute `receiver` may be missing on object of type `RTCRtpTransceiver | None | @Todo`
- src/aiortc/rtcpeerconnection.py:593:17: error[invalid-assignment] Object of type `Unknown & ~Literal["auto"]` is not assignable to attribute `role` on type `RTCDtlsParameters | None`
+ src/aiortc/rtcpeerconnection.py:593:17: error[invalid-assignment] Object of type `@Todo & ~Literal["auto"]` is not assignable to attribute `role` on type `RTCDtlsParameters | None`
- src/aiortc/rtcpeerconnection.py:675:33: error[invalid-argument-type] Argument to function `get_media` is incorrect: Expected `SessionDescription`, found `SessionDescription | None | @Todo`
- src/aiortc/rtcpeerconnection.py:676:34: error[invalid-argument-type] Argument to function `get_media` is incorrect: Expected `SessionDescription`, found `SessionDescription | None | @Todo`
- src/aiortc/rtcpeerconnection.py:684:17: warning[possibly-missing-attribute] Attribute `_set_mline_index` may be missing on object of type `RTCRtpTransceiver | None | @Todo`
- src/aiortc/rtcpeerconnection.py:687:25: error[invalid-argument-type] Argument to function `create_media_description_for_transceiver` is incorrect: Expected `RTCRtpTransceiver`, found `RTCRtpTransceiver | None | @Todo`
- src/aiortc/rtcpeerconnection.py:689:35: warning[possibly-missing-attribute] Attribute `direction` may be missing on object of type `RTCRtpTransceiver | None | @Todo`
- src/aiortc/rtcpeerconnection.py:833:17: warning[possibly-missing-attribute] Attribute `_set_mid` may be missing on object of type `RTCRtpTransceiver | None | @Todo`
- src/aiortc/rtcpeerconnection.py:849:21: warning[possibly-missing-attribute] Attribute `receiver` may be missing on object of type `RTCRtpTransceiver | None | @Todo`
- src/aiortc/rtcpeerconnection.py:863:50: warning[possibly-missing-attribute] Attribute `receiver` may be missing on object of type `RTCRtpTransceiver | None | @Todo`
- src/aiortc/rtcpeerconnection.py:1237:17: error[invalid-argument-type] Method `__getitem__` of type `Overload[(i: SupportsIndex, /) -> MediaDescription, (s: slice[Any, Any, Any], /) -> list[MediaDescription]]` cannot be called with key of type `None` on object of type `list[MediaDescription]`
- src/aiortc/rtcpeerconnection.py:1237:17: warning[possibly-missing-attribute] Attribute `media` may be missing on object of type `SessionDescription | None | @Todo`
- src/aiortc/rtcpeerconnection.py:1407:71: warning[possibly-missing-attribute] Attribute `media` may be missing on object of type `SessionDescription | None | @Todo`
- src/aiortc/rtcsctptransport.py:1095:33: error[invalid-argument-type] Argument to bound method `_receive` is incorrect: Expected `int`, found `int | bytes | @Todo`
- src/aiortc/rtcsctptransport.py:1095:33: error[invalid-argument-type] Argument to bound method `_receive` is incorrect: Expected `int`, found `int | bytes | @Todo`
- src/aiortc/rtcsctptransport.py:1095:33: error[invalid-argument-type] Argument to bound method `_receive` is incorrect: Expected `bytes`, found `int | bytes | @Todo`
- src/aiortc/rtcsctptransport.py:1131:37: error[invalid-argument-type] Argument to bound method `_receive` is incorrect: Expected `int`, found `int | bytes | @Todo`
- src/aiortc/rtcsctptransport.py:1131:37: error[invalid-argument-type] Argument to bound method `_receive` is incorrect: Expected `int`, found `int | bytes | @Todo`
- src/aiortc/rtcsctptransport.py:1131:37: error[invalid-argument-type] Argument to bound method `_receive` is incorrect: Expected `bytes`, found `int | bytes | @Todo`
- Found 194 diagnostics
+ Found 169 diagnostics

jinja (https://github.com/pallets/jinja)
- tests/test_loader.py:240:17: warning[possibly-missing-attribute] Attribute `get_template` may be missing on object of type `Unknown | None | Environment`
+ tests/test_loader.py:240:17: warning[possibly-missing-attribute] Attribute `get_template` may be missing on object of type `Unknown | Environment | None`
- tests/test_loader.py:244:17: warning[possibly-missing-attribute] Attribute `get_template` may be missing on object of type `Unknown | None | Environment`
+ tests/test_loader.py:244:17: warning[possibly-missing-attribute] Attribute `get_template` may be missing on object of type `Unknown | Environment | None`
- tests/test_loader.py:261:9: warning[possibly-missing-attribute] Attribute `get_template` may be missing on object of type `Unknown | None | Environment`
+ tests/test_loader.py:261:9: warning[possibly-missing-attribute] Attribute `get_template` may be missing on object of type `Unknown | Environment | None`
- tests/test_loader.py:263:16: warning[possibly-missing-attribute] Attribute `loader` may be missing on object of type `Unknown | None | Environment`
+ tests/test_loader.py:263:16: warning[possibly-missing-attribute] Attribute `loader` may be missing on object of type `Unknown | Environment | None`
- tests/test_loader.py:265:24: warning[possibly-missing-attribute] Attribute `loader` may be missing on object of type `Unknown | None | Environment`
+ tests/test_loader.py:265:24: warning[possibly-missing-attribute] Attribute `loader` may be missing on object of type `Unknown | Environment | None`
- tests/test_loader.py:282:9: error[invalid-assignment] Object of type `ChoiceLoader` is not assignable to attribute `loader` on type `Unknown | None | Environment`
+ tests/test_loader.py:282:9: error[invalid-assignment] Object of type `ChoiceLoader` is not assignable to attribute `loader` on type `Unknown | Environment | None`
- tests/test_loader.py:283:14: warning[possibly-missing-attribute] Attribute `loader` may be missing on object of type `Unknown | None | Environment`
+ tests/test_loader.py:283:14: warning[possibly-missing-attribute] Attribute `loader` may be missing on object of type `Unknown | Environment | None`
- tests/test_loader.py:285:17: warning[possibly-missing-attribute] Attribute `get_template` may be missing on object of type `Unknown | None | Environment`
+ tests/test_loader.py:285:17: warning[possibly-missing-attribute] Attribute `get_template` may be missing on object of type `Unknown | Environment | None`
- tests/test_loader.py:287:17: warning[possibly-missing-attribute] Attribute `get_template` may be missing on object of type `Unknown | None | Environment`
+ tests/test_loader.py:287:17: warning[possibly-missing-attribute] Attribute `get_template` may be missing on object of type `Unknown | Environment | None`
- tests/test_loader.py:292:9: error[invalid-assignment] Object of type `PrefixLoader` is not assignable to attribute `loader` on type `Unknown | None | Environment`
+ tests/test_loader.py:292:9: error[invalid-assignment] Object of type `PrefixLoader` is not assignable to attribute `loader` on type `Unknown | Environment | None`
- tests/test_loader.py:294:24: warning[possibly-missing-attribute] Attribute `loader` may be missing on object of type `Unknown | None | Environment`
+ tests/test_loader.py:294:24: warning[possibly-missing-attribute] Attribute `loader` may be missing on object of type `Unknown | Environment | None`
- tests/test_loader.py:298:17: warning[possibly-missing-attribute] Attribute `get_template` may be missing on object of type `Unknown | None | Environment`
+ tests/test_loader.py:298:17: warning[possibly-missing-attribute] Attribute `get_template` may be missing on object of type `Unknown | Environment | None`
- tests/test_loader.py:300:17: warning[possibly-missing-attribute] Attribute `get_template` may be missing on object of type `Unknown | None | Environment`
+ tests/test_loader.py:300:17: warning[possibly-missing-attribute] Attribute `get_template` may be missing on object of type `Unknown | Environment | None`
- tests/test_loader.py:306:20: warning[possibly-missing-attribute] Attribute `loader` may be missing on object of type `Unknown | None | Environment`
+ tests/test_loader.py:306:20: warning[possibly-missing-attribute] Attribute `loader` may be missing on object of type `Unknown | Environment | None`
- tests/test_loader.py:315:20: warning[possibly-missing-attribute] Attribute `loader` may be missing on object of type `Unknown | None | Environment`
+ tests/test_loader.py:315:20: warning[possibly-missing-attribute] Attribute `loader` may be missing on object of type `Unknown | Environment | None`

boostedblob (https://github.com/hauntsaninja/boostedblob)
- boostedblob/boost.py:362:9: error[unresolved-attribute] Object of type `Collection[Awaitable[T@OrderedMappingBoostable]]` has no attribute `append`
- boostedblob/boost.py:368:16: error[unresolved-attribute] Object of type `Collection[Awaitable[T@OrderedMappingBoostable]] & ~AlwaysFalsy` has no attribute `popleft`
- boostedblob/boost.py:382:19: error[not-subscriptable] Cannot subscript object of type `Collection[Awaitable[T@OrderedMappingBoostable]]` with no `__getitem__` method
- boostedblob/boost.py:402:9: error[unresolved-attribute] Object of type `Collection[Awaitable[T@UnorderedMappingBoostable]]` has no attribute `add`
- boostedblob/boost.py:413:55: error[unresolved-attribute] Object of type `Awaitable[T@UnorderedMappingBoostable]` has no attribute `done`
- boostedblob/boost.py:416:9: error[unresolved-attribute] Object of type `Collection[Awaitable[T@UnorderedMappingBoostable]]` has no attribute `remove`
- Found 21 diagnostics
+ Found 15 diagnostics

scrapy (https://github.com/scrapy/scrapy)
- tests/test_scheduler.py:180:23: error[invalid-argument-type] Argument to bound method `__call__` is incorrect: Expected `str | bytes | PathLike[str] | PathLike[bytes]`, found `Unknown | None | str`
+ tests/test_scheduler.py:180:23: error[invalid-argument-type] Argument to bound method `__call__` is incorrect: Expected `str | bytes | PathLike[str] | PathLike[bytes]`, found `Unknown | str | None`

pytest (https://github.com/pytest-dev/pytest)
- src/_pytest/python.py:1043:34: error[invalid-argument-type] Argument to function `ascii_escaped` is incorrect: Expected `bytes | str`, found `object`
- src/_pytest/subtests.py:85:24: error[not-iterable] Object of type `None` is not iterable
- Found 413 diagnostics
+ Found 411 diagnostics

graphql-core (https://github.com/graphql-python/graphql-core)
- src/graphql/execution/incremental_graph.py:349:27: error[invalid-argument-type] Argument to bound method `_enqueue` is incorrect: Expected `ReconcilableDeferredGroupedFieldSetResult | NonReconcilableDeferredGroupedFieldSetResult | StreamItemsResult`, found `object`
- src/graphql/execution/incremental_graph.py:383:16: error[unresolved-attribute] Object of type `object` has no attribute `item`
- src/graphql/execution/incremental_graph.py:393:66: error[unresolved-attribute] Object of type `object` has no attribute `errors`
- src/graphql/execution/incremental_graph.py:396:25: error[unresolved-attribute] Object of type `object` has no attribute `item`
- src/graphql/execution/incremental_graph.py:397:16: error[unresolved-attribute] Object of type `object` has no attribute `errors`
- src/graphql/execution/incremental_graph.py:398:31: error[unresolved-attribute] Object of type `object` has no attribute `errors`
- src/graphql/execution/incremental_graph.py:399:16: error[unresolved-attribute] Object of type `object` has no attribute `incremental_data_records`
- src/graphql/execution/incremental_graph.py:400:49: error[unresolved-attribute] Object of type `object` has no attribute `incremental_data_records`
- src/graphql/type/definition.py:430:27: error[invalid-argument-type] Invalid argument to key "parse_literal" with declared type `((ValueNode, dict[str, Any] | None, /) -> Any) | None` on TypedDict `GraphQLScalarTypeKwargs`: value of type `None | (bound method Self@to_kwargs.parse_literal(node: ValueNode, variables: dict[str, Any] | None = None) -> Any) | (def parse_literal(self, node: ValueNode, variables: dict[str, Any] | None = None) -> Any)`
+ src/graphql/type/definition.py:430:27: error[invalid-argument-type] Invalid argument to key "parse_literal" with declared type `((ValueNode, dict[str, Any] | None, /) -> Any) | None` on TypedDict `GraphQLScalarTypeKwargs`: value of type `None | (def parse_literal(self, node: ValueNode, variables: dict[str, Any] | None = None) -> Any)`
- Found 641 diagnostics
+ Found 633 diagnostics

dulwich (https://github.com/dulwich/dulwich)
- dulwich/server.py:604:13: error[invalid-argument-type] Argument to bound method `find_missing_objects` is incorrect: Expected `((bytes, /) -> None) | None`, found `(bound method [email protected](message: bytes) -> None) | (def progress(self, message: bytes) -> None)`
+ dulwich/server.py:604:13: error[invalid-argument-type] Argument to bound method `find_missing_objects` is incorrect: Expected `((bytes, /) -> None) | None`, found `def progress(self, message: bytes) -> None`
- dulwich/server.py:649:21: error[invalid-argument-type] Argument to function `filter_pack_objects_with_paths` is incorrect: Expected `((bytes, /) -> None) | None`, found `(bound method [email protected](message: bytes) -> None) | (def progress(self, message: bytes) -> None)`
+ dulwich/server.py:649:21: error[invalid-argument-type] Argument to function `filter_pack_objects_with_paths` is incorrect: Expected `((bytes, /) -> None) | None`, found `def progress(self, message: bytes) -> None`

PyGithub (https://github.com/PyGithub/PyGithub)
- tests/Requester.py:216:9: warning[possibly-missing-attribute] Attribute `info` may be missing on object of type `Unknown | None | MagicMock`
- tests/Requester.py:263:9: warning[possibly-missing-attribute] Attribute `info` may be missing on object of type `Unknown | None | MagicMock`
- Found 299 diagnostics
+ Found 297 diagnostics

poetry (https://github.com/python-poetry/poetry)
+ src/poetry/console/commands/build.py:242:68: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
+ tests/console/commands/test_show.py:42:12: warning[redundant-cast] Value is already of type `F@output_format_parametrize`
- Found 977 diagnostics
+ Found 979 diagnostics

tornado (https://github.com/tornadoweb/tornado)
- tornado/iostream.py:1343:13: warning[possibly-missing-attribute] Attribute `getpeername` may be missing on object of type `Unknown | None | socket`
+ tornado/iostream.py:1343:13: warning[possibly-missing-attribute] Attribute `getpeername` may be missing on object of type `Unknown | socket | None`
- tornado/iostream.py:1363:13: warning[possibly-missing-attribute] Attribute `do_handshake` may be missing on object of type `Unknown | None | socket`
+ tornado/iostream.py:1363:13: warning[possibly-missing-attribute] Attribute `do_handshake` may be missing on object of type `Unknown | socket | None`
- tornado/iostream.py:1375:28: warning[possibly-missing-attribute] Attribute `getpeername` may be missing on object of type `Unknown | None | socket`
+ tornado/iostream.py:1375:28: warning[possibly-missing-attribute] Attribute `getpeername` may be missing on object of type `Unknown | socket | None`
- tornado/iostream.py:1379:47: warning[possibly-missing-attribute] Attribute `fileno` may be missing on object of type `Unknown | None | socket`
+ tornado/iostream.py:1379:47: warning[possibly-missing-attribute] Attribute `fileno` may be missing on object of type `Unknown | socket | None`
- tornado/iostream.py:1461:37: error[invalid-argument-type] Argument to bound method `remove_handler` is incorrect: Expected `int | _Selectable`, found `Unknown | None | socket`
+ tornado/iostream.py:1461:37: error[invalid-argument-type] Argument to bound method `remove_handler` is incorrect: Expected `int | _Selectable`, found `Unknown | socket | None`
- tornado/iostream.py:1466:13: error[invalid-argument-type] Argument to function `ssl_wrap_socket` is incorrect: Expected `socket`, found `Unknown | None | socket`
+ tornado/iostream.py:1466:13: error[invalid-argument-type] Argument to function `ssl_wrap_socket` is incorrect: Expected `socket`, found `Unknown | socket | None`
- tornado/iostream.py:1542:24: warning[possibly-missing-attribute] Attribute `recv_into` may be missing on object of type `Unknown | None | socket`
+ tornado/iostream.py:1542:24: warning[possibly-missing-attribute] Attribute `recv_into` may be missing on object of type `Unknown | socket | None`
- tornado/queues.py:175:20: error[invalid-argument-type] Argument to function `len` is incorrect: Expected `Sized`, found `Unknown | None | deque[Unknown]`
- tornado/queues.py:310:16: warning[possibly-missing-attribute] Attribute `popleft` may be missing on object of type `Unknown | None | deque[Unknown]`
- tornado/queues.py:313:9: warning[possibly-missing-attribute] Attribute `append` may be missing on object of type `Unknown | None | deque[Unknown]`
- tornado/queues.py:382:24: error[invalid-argument-type] Argument to function `heappush` is incorrect: Expected `list[Unknown]`, found `Unknown | None | list[Unknown] | deque[Unknown]`
+ tornado/queues.py:382:24: error[invalid-argument-type] Argument to function `heappush` is incorrect: Expected `list[Unknown]`, found `Unknown | list[Unknown] | deque[Unknown]`
- tornado/queues.py:385:30: error[invalid-argument-type] Argument to function `heappop` is incorrect: Expected `list[Unknown]`, found `Unknown | None | list[Unknown] | deque[Unknown]`
+ tornado/queues.py:385:30: error[invalid-argument-type] Argument to function `heappop` is incorrect: Expected `list[Unknown]`, found `Unknown | list[Unknown] | deque[Unknown]`
- tornado/queues.py:419:9: warning[possibly-missing-attribute] Attribute `append` may be missing on object of type `Unknown | None | list[Unknown] | deque[Unknown]`
- tornado/queues.py:422:16: warning[possibly-missing-attribute] Attribute `pop` may be missing on object of type `Unknown | None | list[Unknown] | deque[Unknown]`
- tornado/test/netutil_test.py:100:24: warning[possibly-missing-attribute] Attribute `resolve` may be missing on object of type `Unknown | None | OverrideResolver`
- tornado/test/netutil_test.py:103:24: warning[possibly-missing-attribute] Attribute `resolve` may be missing on object of type `Unknown | None | OverrideResolver`
- tornado/test/netutil_test.py:116:9: warning[possibly-missing-attribute] Attribute `close` may be missing on object of type `Unknown | None | ThreadedResolver`
- tornado/web.py:1214:30: error[not-iterable] Object of type `Unknown | None | list[OutputTransform]` may not be iterable
- tornado/web.py:1239:30: error[not-iterable] Object of type `Unknown | None | list[OutputTransform]` may not be iterable
- tornado/websocket.py:1086:16: warning[possibly-missing-attribute] Attribute `write` may be missing on object of type `Unknown | None | IOStream`
+ tornado/websocket.py:1086:16: warning[possibly-missing-attribute] Attribute `write` may be missing on object of type `Unknown | IOStream | None`
- tornado/websocket.py:1137:22: warning[possibly-missing-attribute] Attribute `read_bytes` may be missing on object of type `Unknown | None | IOStream`
+ tornado/websocket.py:1137:22: warning[possibly-missing-attribute] Attribute `read_bytes` may be missing on object of type `Unknown | IOStream | None`
- tornado/websocket.py:1278:20: warning[possibly-missing-attribute] Attribute `closed` may be missing on object of type `Unknown | None | IOStream`
+ tornado/websocket.py:1278:20: warning[possibly-missing-attribute] Attribute `closed` may be missing on object of type `Unknown | IOStream | None`
- tornado/websocket.py:1294:17: warning[possibly-missing-attribute] Attribute `io_loop` may be missing on object of type `Unknown | None | IOStream`
+ tornado/websocket.py:1294:17: warning[possibly-missing-attribute] Attribute `io_loop` may be missing on object of type `Unknown | IOStream | None`
- tornado/websocket.py:1296:13: warning[possibly-missing-attribute] Attribute `close` may be missing on object of type `Unknown | None | IOStream`
+ tornado/websocket.py:1296:13: warning[possibly-missing-attribute] Attribute `close` may be missing on object of type `Unknown | IOStream | None`
- tornado/websocket.py:1300:29: warning[possibly-missing-attribute] Attribute `io_loop` may be missing on object of type `Unknown | None | IOStream`
+ tornado/websocket.py:1300:29: warning[possibly-missing-attribute] Attribute `io_loop` may be missing on object of type `Unknown | IOStream | None`
- tornado/websocket.py:1301:17: warning[possibly-missing-attribute] Attribute `io_loop` may be missing on object of type `Unknown | None | IOStream`
+ tornado/websocket.py:1301:17: warning[possibly-missing-attribute] Attribute `io_loop` may be missing on object of type `Unknown | IOStream | None`
- tornado/websocket.py:1314:16: warning[possibly-missing-attribute] Attribute `closed` may be missing on object of type `Unknown | None | IOStream`
+ tornado/websocket.py:1314:16: warning[possibly-missing-attribute] Attribute `closed` may be missing on object of type `Unknown | IOStream | None`
- tornado/websocket.py:1317:9: warning[possibly-missing-attribute] Attribute `set_nodelay` may be missing on object of type `Unknown | None | IOStream`
+ tornado/websocket.py:1317:9: warning[possibly-missing-attribute] Attribute `set_nodelay` may be missing on object of type `Unknown | IOStream | None`
- Found 327 diagnostics
+ Found 317 diagnostics

mitmproxy (https://github.com/mitmproxy/mitmproxy)
- examples/contrib/search.py:68:23: warning[possibly-missing-attribute] Attribute `findall` may be missing on object of type `Unknown | Pattern[str] | None`
+ examples/contrib/search.py:68:23: warning[possibly-missing-attribute] Attribute `findall` may be missing on object of type `Unknown | None | Pattern[str]`
- examples/contrib/search.py:73:41: warning[possibly-missing-attribute] Attribute `findall` may be missing on object of type `Unknown | Pattern[str] | None`
+ examples/contrib/search.py:73:41: warning[possibly-missing-attribute] Attribute `findall` may be missing on object of type `Unknown | None | Pattern[str]`
- examples/contrib/search.py:75:45: warning[possibly-missing-attribute] Attribute `findall` may be missing on object of type `Unknown | Pattern[str] | None`
+ examples/contrib/search.py:75:45: warning[possibly-missing-attribute] Attribute `findall` may be missing on object of type `Unknown | None | Pattern[str]`
- examples/contrib/search.py:78:49: warning[possibly-missing-attribute] Attribute `findall` may be missing on object of type `Unknown | Pattern[str] | None`
+ examples/contrib/search.py:78:49: warning[possibly-missing-attribute] Attribute `findall` may be missing on object of type `Unknown | None | Pattern[str]`
- examples/contrib/search.py:82:50: warning[possibly-missing-attribute] Attribute `findall` may be missing on object of type `Unknown | Pattern[str] | None`
+ examples/contrib/search.py:82:50: warning[possibly-missing-attribute] Attribute `findall` may be missing on object of type `Unknown | None | Pattern[str]`
- mitmproxy/tools/console/commands.py:109:38: error[invalid-argument-type] Argument to bound method `connect` is incorrect: Expected `(text) -> None`, found `(bound method Self@__init__.sig_mod(txt) -> Unknown) | @Todo`
- mitmproxy/tools/console/flowview.py:350:33: error[invalid-assignment] Object of type `Unknown | None` is not assignable to `Message`
- Found 2143 diagnostics
+ Found 2141 diagnostics

vision (https://github.com/pytorch/vision)
- torchvision/models/densenet.py:62:37: error[invalid-argument-type] Argument to bound method `bn_function` is incorrect: Expected `list[Unknown]`, found `tuple[Unknown, ...]`
+ torchvision/prototype/datasets/_builtin/caltech.py:84:70: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
+ torchvision/prototype/datasets/_builtin/caltech.py:95:68: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
+ torchvision/prototype/datasets/_builtin/imagenet.py:141:79: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- torchvision/transforms/transforms.py:1537:30: error[invalid-argument-type] Argument to function `affine` is incorrect: Expected `int | float`, found `int | float | tuple[int | float, int | float] | @Todo`
- torchvision/transforms/transforms.py:1537:30: error[invalid-argument-type] Argument to function `affine` is incorrect: Expected `list[int]`, found `int | float | tuple[int | float, int | float] | @Todo`
- torchvision/transforms/transforms.py:1537:30: error[invalid-argument-type] Argument to function `affine` is incorrect: Expected `int | float`, found `int | float | tuple[int | float, int | float] | @Todo`
- torchvision/transforms/transforms.py:1537:30: error[invalid-argument-type] Argument to function `affine` is incorrect: Expected `list[int | float]`, found `int | float | tuple[int | float, int | float] | @Todo`
- torchvision/transforms/transforms.py:1537:30: error[invalid-argument-type] Argument to function `affine` is incorrect: Expected `InterpolationMode`, found `int | float | tuple[int | float, int | float] | @Todo`
- torchvision/transforms/transforms.py:1537:30: error[invalid-argument-type] Argument to function `affine` is incorrect: Expected `list[int | float] | None`, found `int | float | tuple[int | float, int | float] | @Todo`
- torchvision/transforms/transforms.py:1537:30: error[invalid-argument-type] Argument to function `affine` is incorrect: Expected `list[int] | None`, found `int | float | tuple[int | float, int | float] | @Todo`
- Found 1403 diagnostics
+ Found 1398 diagnostics

urllib3 (https://github.com/urllib3/urllib3)
- src/urllib3/connection.py:560:9: warning[possibly-missing-attribute] Attribute `settimeout` may be missing on object of type `socket | Any | None`
+ src/urllib3/connection.py:560:9: warning[possibly-missing-attribute] Attribute `settimeout` may be missing on object of type `Unknown | socket | None`
- src/urllib3/http2/connection.py:110:17: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `socket | Any | SSLTransport | None`
+ src/urllib3/http2/connection.py:110:17: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `Unknown | socket | SSLTransport | None`
- src/urllib3/http2/connection.py:167:17: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `socket | Any | SSLTransport | None`
+ src/urllib3/http2/connection.py:167:17: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `Unknown | socket | SSLTransport | None`
- src/urllib3/http2/connection.py:180:17: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `socket | Any | SSLTransport | None`
+ src/urllib3/http2/connection.py:180:17: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `Unknown | socket | SSLTransport | None`
- src/urllib3/http2/connection.py:191:25: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `socket | Any | SSLTransport | None`
+ src/urllib3/http2/connection.py:191:25: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `Unknown | socket | SSLTransport | None`
- src/urllib3/http2/connection.py:202:25: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `socket | Any | SSLTransport | None`
+ src/urllib3/http2/connection.py:202:25: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `Unknown | socket | SSLTransport | None`
- src/urllib3/http2/connection.py:207:29: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `socket | Any | SSLTransport | None`
+ src/urllib3/http2/connection.py:207:29: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `Unknown | socket | SSLTransport | None`
- src/urllib3/http2/connection.py:235:37: warning[possibly-missing-attribute] Attribute `recv` may be missing on object of type `socket | Any | SSLTransport | None`
+ src/urllib3/http2/connection.py:235:37: warning[possibly-missing-attribute] Attribute `recv` may be missing on object of type `Unknown | socket | SSLTransport | None`
- src/urllib3/http2/connection.py:258:21: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `socket | Any | SSLTransport | None`
+ src/urllib3/http2/connection.py:258:21: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `Unknown | socket | SSLTransport | None`
- src/urllib3/http2/connection.py:312:21: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `socket | Any | SSLTransport | None`
+ src/urllib3/http2/connection.py:312:21: warning[possibly-missing-attribute] Attribute `sendall` may be missing on object of type `Unknown | socket | SSLTransport | None`
+ src/urllib3/poolmanager.py:615:91: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- Found 303 diagnostics
+ Found 304 diagnostics

antidote (https://github.com/Finistere/antidote)
- src/antidote/core/_raw/wrapper.py:102:13: warning[possibly-missing-attribute] Attribute `__get__` may be missing on object of type `((...) -> object) | ((...) -> object)`
- src/antidote/core/_raw/wrapper.py:136:13: warning[possibly-missing-attribute] Attribute `__get__` may be missing on object of type `((...) -> Awaitable[object]) | ((...) -> Awaitable[object])`
+ src/antidote/core/_raw/wrapper.py:102:13: error[unresolved-attribute] Object of type `(...) -> object` has no attribute `__get__`
+ src/antidote/core/_raw/wrapper.py:136:13: error[unresolved-attribute] Object of type `(...) -> Awaitable[object]` has no attribute `__get__`

psycopg (https://github.com/psycopg/psycopg)
- docs/lib/libpq_docs.py:99:16: error[not-subscriptable] Cannot subscript object of type `None` with no `__getitem__` method
- Found 652 diagnostics
+ Found 651 diagnostics

discord.py (https://github.com/Rapptz/discord.py)
- discord/app_commands/errors.py:453:95: error[unresolved-attribute] Object of type `Top[(...) -> Coroutine[object, Never, object]]` has no attribute `__qualname__`
+ discord/app_commands/errors.py:453:95: warning[possibly-missing-attribute] Attribute `__qualname__` may be missing on object of type `Unknown | ((...) -> Coroutine[Any, Any, Unknown])`
- discord/asset.py:462:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ConnectionState[Client] | _WebhookState`, found `Any | None | ConnectionState[Client] | _WebhookState`
- discord/asset.py:490:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ConnectionState[Client] | _WebhookState`, found `Any | None | ConnectionState[Client] | _WebhookState`
- discord/asset.py:525:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ConnectionState[Client] | _WebhookState`, found `Any | None | ConnectionState[Client] | _WebhookState`
- discord/emoji.py:131:42: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ConnectionState[Client]`, found `Any | None | ConnectionState[Client]`
- discord/emoji.py:186:16: warning[possibly-missing-attribute] Attribute `_get_guild` may be missing on object of type `Any | None | ConnectionState[Client]`
- discord/emoji.py:225:30: warning[possibly-missing-attribute] Attribute `application_id` may be missing on object of type `Any | None | ConnectionState[Client]`
- discord/emoji.py:229:19: warning[possibly-missing-attribute] Attribute `http` may be missing on object of type `Any | None | ConnectionState[Client]`
- discord/emoji.py:232:15: warning[possibly-missing-attribute] Attribute `http` may be missing on object of type `Any | None | ConnectionState[Client]`
- discord/emoji.py:282:30: warning[possibly-missing-attribute] Attribute `application_id` may be missing on object of type `Any | None | ConnectionState[Client]`
- discord/emoji.py:287:26: warning[possibly-missing-attribute] Attribute `http` may be missing on object of type `Any | None | ConnectionState[Client]`
- discord/emoji.py:292:54: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ConnectionState[Client]`, found `Any | None | ConnectionState[Client]`
- discord/emoji.py:294:22: warning[possibly-missing-attribute] Attribute `http` may be missing on object of type `Any | None | ConnectionState[Client]`
- discord/ext/commands/cog.py:288:36: error[invalid-type-arguments] Type `<special-form 'typing.Self'>` is not assignable to upper bound `Cog | None` of type variable `CogT@Command`
- discord/ext/commands/cog.py:289:79: error[invalid-type-arguments] Type `<special-form 'typing.Self'>` is not assignable to upper bound `Group | Cog` of type variable `GroupT@Command`
- discord/ext/tasks/__init__.py:304:9: error[invalid-assignment] Object of type `(bound method Self@__get__._error(*args: Any) -> CoroutineType[Any, Any, None]) | (def _error(self, *args: Any) -> CoroutineType[Any, Any, None])` is not assignable to attribute `_error` of type `def _error(self, *args: Any) -> CoroutineType[Any, Any, None]`
- discord/soundboard.py:232:20: warning[possibly-missing-attribute] Attribute `get_user` may be missing on object of type `Any | None | ConnectionState[Client]`
- discord/soundboard.py:233:21: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ConnectionState[Client]`, found `Any | None | ConnectionState[Client]`
- discord/soundboard.py:301:22: warning[possibly-missing-attribute] Attribute `http` may be missing on object of type `Any | None | ConnectionState[Client]`
- discord/soundboard.py:302:50: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ConnectionState[Client]`, found `Any | None | ConnectionState[Client]`
- discord/soundboard.py:325:15: warning[possibly-missing-attribute] Attribute `http` may be missing on object of type `Any | None | ConnectionState[Client]`
- discord/sticker.py:230:38: warning[possibly-missing-attribute] Attribute `http` may be missing on object of type `Any | None | ConnectionState[Client]`
- discord/sticker.py:232:20: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ConnectionState[Client]`, found `Any | None | ConnectionState[Client]`
- discord/sticker.py:369:22: warning[possibly-missing-attribute] Attribute `http` may be missing on object of type `Any | None | ConnectionState[Client]`
- discord/sticker.py:370:28: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ConnectionState[Client]`, found `Any | None | ConnectionState[Client]`
- discord/sticker.py:420:37: warning[possibly-missing-attribute] Attribute `store_user` may be missing on object of type `Any | None | ConnectionState[Client]`
- discord/sticker.py:434:16: warning[possibly-missing-attribute] Attribute `_get_guild` may be missing on object of type `Any | None | ConnectionState[Client]`
- discord/sticker.py:489:43: warning[possibly-missing-attribute] Attribute `http` may be missing on object of type `Any | None | ConnectionState[Client]`
- discord/sticker.py:490:29: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `ConnectionState[Client]`, found `Any | None | ConnectionState[Client]`
- discord/sticker.py:511:15: warning[possibly-missing-attribute] Attribute `http` may be missing on object of type `Any | None | ConnectionState[Client]`
- discord/ui/action_row.py:122:67: error[invalid-type-arguments] Type `<special-form 'typing.Self'>` is not assignable to upper bound `BaseView | ActionRow[Unknown] | Container[Unknown]` of type variable `C@ContainedItemCallbackType`
+ discord/ui/action_row.py:154:9: error[invalid-assignment] Object of type `list[((ActionRow[Unknown], Interaction[Any], Any, /) -> Coroutine[Any, Any, Any]) | ((Self@__init_subclass__, Interaction[Any], Any, /) -> Coroutine[Any, Any, Any])]` is not assignable to attribute `__action_row_children_items__` of type `list[(ActionRow[Unknown], Interaction[Any], Any, /) -> Coroutine[Any, Any, Any]]`
- discord/ui/action_row.py:163:26: error[unresolved-attribute] Object of type `(Unknown, Interaction[Any], Any, /) -> Coroutine[Any, Any

... (truncated 1997 lines) ...

No memory usage changes detected ✅

@charliermarsh
Copy link
Member Author

(A lot of conformance and ecosystem changes to review before this will be ready.)

@charliermarsh

This comment was marked as resolved.

@charliermarsh

This comment was marked as resolved.

@charliermarsh
Copy link
Member Author

charliermarsh commented Jan 10, 2026

I believe the conformance changes are also improvements.

The removal of generics_self_attributes.py:29:5 is corrrect.

The removal of generics_self_usage.py:50:34 is correct.

@charliermarsh charliermarsh force-pushed the charlie/self branch 2 times, most recently from 79ea13f to 3230c74 Compare January 10, 2026 00:59
@charliermarsh
Copy link
Member Author

Current version looks better but needs more review of the ecosystem changes.

@charliermarsh charliermarsh force-pushed the charlie/self branch 3 times, most recently from cfcceae to 2c8fb42 Compare January 10, 2026 17:01
@charliermarsh charliermarsh marked this pull request as ready for review January 10, 2026 17:01
@charliermarsh charliermarsh changed the title [ty] Bind typing.Self in class attributes and assignment [ty] Fix incorrect Self binding for bound methods stored as instance attributes Jan 10, 2026
@charliermarsh charliermarsh changed the title [ty] Fix incorrect Self binding for bound methods stored as instance attributes [ty] Bind typing.Self in class attributes and assignment Jan 10, 2026
@AlexWaygood AlexWaygood removed their request for review January 14, 2026 14:20
@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 17, 2026

ecosystem-analyzer results

Lint rule Added Removed Changed
unresolved-attribute 950 86 10
possibly-missing-attribute 62 163 87
invalid-argument-type 13 218 30
invalid-return-type 2 44 43
invalid-assignment 2 72 14
unsupported-operator 0 45 9
call-non-callable 0 44 0
not-subscriptable 0 19 0
invalid-type-arguments 0 18 0
unused-ignore-comment 12 4 0
type-assertion-failure 0 8 4
no-matching-overload 2 6 0
not-iterable 0 8 0
invalid-parameter-default 0 0 7
invalid-raise 0 4 0
invalid-await 2 0 0
parameter-already-assigned 0 1 0
redundant-cast 1 0 0
Total 1,046 740 204

Full report with detailed diff (timing results)

@charliermarsh
Copy link
Member Author

Need to review the ecosystem changes. Look likes all of the new diagnostics are in Zulip.

@charliermarsh charliermarsh force-pushed the charlie/self branch 3 times, most recently from dcc2786 to f251d1f Compare January 17, 2026 17:03
@charliermarsh charliermarsh marked this pull request as draft January 17, 2026 17:03
@charliermarsh charliermarsh force-pushed the charlie/self branch 4 times, most recently from d151913 to 110f839 Compare January 18, 2026 01:47
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 18, 2026

Merging this PR will degrade performance by 12.01%

❌ 5 regressed benchmarks
✅ 18 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 87.7 s 99.7 s -12.01%
WallTime static_frame 21 s 22.5 s -6.85%
WallTime pandas 62.1 s 66.2 s -6.06%
WallTime freqtrade 7.7 s 8.1 s -4.93%
Simulation DateType 236.6 ms 257.2 ms -8.01%

Comparing charlie/self (94a1a2d) with main (2b9fed3)

Open in CodSpeed

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/self branch 2 times, most recently from 9a60d49 to b459a1a Compare January 19, 2026 14:10
@charliermarsh charliermarsh force-pushed the charlie/self branch 2 times, most recently from 2446f16 to 32558cc Compare January 19, 2026 15:07
@charliermarsh
Copy link
Member Author

Replaced by #23108.

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 typing.Self used as attribute (or dataclass field) type

2 participants