Skip to content

Comments

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

Merged
sharkdp merged 13 commits intomainfrom
charlie/self-test
Feb 11, 2026
Merged

[ty] Bind typing.Self in class attributes and assignment#23108
sharkdp merged 13 commits intomainfrom
charlie/self-test

Conversation

@charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Feb 5, 2026

Summary

Closes astral-sh/ty#1124.

@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 5, 2026

Typing conformance results improved 🎉

The percentage of diagnostics emitted that were expected errors increased from 82.63% to 83.14%. The percentage of expected errors that received a diagnostic held steady at 74.24%.

Summary

Metric Old New Diff Outcome
True Positives 804 804 +0
False Positives 169 163 -6 ⏬ (✅)
False Negatives 279 279 +0
Total Diagnostics 973 967 -6
Precision 82.63% 83.14% +0.51% ⏫ (✅)
Recall 74.24% 74.24% +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_advanced.py:43:9 type-assertion-failure Type list[Self@method3] does not match asserted type list[<special-form 'typing.Self'>]
generics_self_advanced.py:44:9 type-assertion-failure Type Self@method3 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 Feb 5, 2026

mypy_primer results

Changes were detected when running on open source projects
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:746: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:797:28: error[invalid-argument-type] Argument is incorrect: Expected `Self@__init__`, found `Self@remove`
- src/werkzeug/datastructures/structures.py:812:28: error[invalid-argument-type] Argument is incorrect: Expected `Self@__init__`, found `Self@update`
- src/werkzeug/datastructures/structures.py:852:28: error[invalid-argument-type] Argument is incorrect: Expected `Self@__init__`, found `Self@clear`
- src/werkzeug/datastructures/structures.py:878:28: error[invalid-argument-type] Argument is incorrect: Expected `Self@__init__`, found `Self@__delitem__`
- src/werkzeug/datastructures/structures.py:886:28: error[invalid-argument-type] Argument is incorrect: Expected `Self@__init__`, found `Self@__setitem__`
- Found 397 diagnostics
+ Found 388 diagnostics

poetry (https://github.com/python-poetry/poetry)
+ tests/console/commands/test_show.py:42:12: warning[redundant-cast] Value is already of type `F@output_format_parametrize`
- Found 978 diagnostics
+ Found 979 diagnostics

Expression (https://github.com/cognitedata/Expression)
- tests/test_compose.py:21:16: error[invalid-assignment] Object of type `(Never, /) -> Never` is not assignable to `(int, /) -> int`
- Found 205 diagnostics
+ Found 204 diagnostics

Tanjun (https://github.com/FasterSpeeding/Tanjun)
- tanjun/annotations.py:2520:30: error[invalid-argument-type] Argument is incorrect: Expected `<special-form 'typing.Self'>`, found `Self@add_to_slash_cmds`
+ tanjun/annotations.py:2524:25: error[invalid-type-form] `ClassVar` cannot contain type variables
- tanjun/commands/slash.py:1435:22: error[invalid-assignment] Object of type `<special-form 'typing.Self'>` is not assignable to `CommandInteractionOption | None`
- tanjun/commands/slash.py:1441:42: warning[possibly-missing-attribute] Attribute `name` may be missing on object of type `CommandInteractionOption | None`
- tanjun/commands/slash.py:1458:22: error[invalid-assignment] Object of type `<special-form 'typing.Self'>` is not assignable to `AutocompleteInteractionOption | None`
- tanjun/commands/slash.py:1464:38: warning[possibly-missing-attribute] Attribute `name` may be missing on object of type `AutocompleteInteractionOption | None`
- tanjun/commands/slash.py:1466:45: warning[possibly-missing-attribute] Attribute `name` may be missing on object of type `AutocompleteInteractionOption | None`
- Found 134 diagnostics
+ Found 129 diagnostics

discord.py (https://github.com/Rapptz/discord.py)
- discord/app_commands/tree.py:1133:33: error[invalid-argument-type] Argument to function `on_error` is incorrect: Argument type `Interaction[ClientT@CommandTree]` does not satisfy upper bound `CommandTree[ClientT@CommandTree]` of type variable `Self`
+ discord/app_commands/tree.py:1133:33: error[invalid-argument-type] Argument to function `on_error` is incorrect: Expected `Self@_dispatch_error`, found `Interaction[ClientT@CommandTree]`
- discord/app_commands/tree.py:1243:33: error[invalid-argument-type] Argument to function `on_error` is incorrect: Argument type `Interaction[ClientT@CommandTree]` does not satisfy upper bound `CommandTree[ClientT@CommandTree]` of type variable `Self`
+ discord/app_commands/tree.py:1243:33: error[invalid-argument-type] Argument to function `on_error` is incorrect: Expected `Self@_call_context_menu`, found `Interaction[ClientT@CommandTree]`
- discord/app_commands/tree.py:1301:33: error[invalid-argument-type] Argument to function `on_error` is incorrect: Argument type `Interaction[ClientT@CommandTree]` does not satisfy upper bound `CommandTree[ClientT@CommandTree]` of type variable `Self`
+ discord/app_commands/tree.py:1301:33: error[invalid-argument-type] Argument to function `on_error` is incorrect: Expected `Self@_call`, found `Interaction[ClientT@CommandTree]`
- discord/channel.py:3234:57: error[invalid-argument-type] Argument to function `store_user` is incorrect: Argument type `PartialUser` does not satisfy upper bound `ConnectionState[ClientT@ConnectionState]` of type variable `Self`
+ discord/channel.py:3234:57: error[invalid-argument-type] Argument to function `store_user` is incorrect: Expected `ConnectionState[Client]`, found `PartialUser`
- discord/channel.py:3409:63: error[invalid-argument-type] Argument to function `store_user` is incorrect: Argument type `PartialUser` does not satisfy upper bound `ConnectionState[ClientT@ConnectionState]` of type variable `Self`
+ discord/channel.py:3409:63: error[invalid-argument-type] Argument to function `store_user` is incorrect: Expected `ConnectionState[Client]`, found `PartialUser`
- 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/member.py:319:45: error[invalid-argument-type] Argument to function `store_user` is incorrect: Argument type `User` does not satisfy upper bound `ConnectionState[ClientT@ConnectionState]` of type variable `Self`
+ discord/member.py:319:45: error[invalid-argument-type] Argument to function `store_user` is incorrect: Expected `ConnectionState[Client]`, found `User`
- discord/message.py:2455:46: error[invalid-argument-type] Argument to function `store_user` is incorrect: Argument type `User` does not satisfy upper bound `ConnectionState[ClientT@ConnectionState]` of type variable `Self`
+ discord/message.py:2455:46: error[invalid-argument-type] Argument to function `store_user` is incorrect: Expected `ConnectionState[Client]`, found `User`
- discord/message.py:2481:47: error[invalid-argument-type] Argument to function `store_user` is incorrect: Argument type `UserWithMember` does not satisfy upper bound `ConnectionState[ClientT@ConnectionState]` of type variable `Self`
+ discord/message.py:2481:47: error[invalid-argument-type] Argument to function `store_user` is incorrect: Expected `ConnectionState[Client]`, found `UserWithMember`
- discord/scheduled_event.py:150:63: error[invalid-argument-type] Argument to function `store_user` is incorrect: Argument type `User` does not satisfy upper bound `ConnectionState[ClientT@ConnectionState]` of type variable `Self`
+ discord/scheduled_event.py:150:63: error[invalid-argument-type] Argument to function `store_user` is incorrect: Expected `ConnectionState[Client]`, found `User`
- discord/state.py:1121:32: error[invalid-argument-type] Argument to function `store_user` is incorrect: Argument type `User` does not satisfy upper bound `ConnectionState[ClientT@ConnectionState]` of type variable `Self`
+ discord/state.py:1121:32: error[invalid-argument-type] Argument to function `store_user` is incorrect: Expected `Self@parse_guild_member_remove`, found `User`
- discord/state.py:1388:36: error[invalid-argument-type] Argument to function `store_user` is incorrect: Argument type `User` does not satisfy upper bound `ConnectionState[ClientT@ConnectionState]` of type variable `Self`
+ discord/state.py:1388:36: error[invalid-argument-type] Argument to function `store_user` is incorrect: Expected `Self@parse_guild_ban_remove`, found `User`
- discord/sticker.py:420:60: error[invalid-argument-type] Argument to function `store_user` is incorrect: Argument type `User` does not satisfy upper bound `ConnectionState[ClientT@ConnectionState]` of type variable `Self`
+ discord/sticker.py:420:60: error[invalid-argument-type] Argument to function `store_user` is incorrect: Expected `ConnectionState[Client]`, found `User`
- 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:122:36: error[invalid-type-form] `ClassVar` cannot contain type variables
+ discord/ui/action_row.py:154:9: error[invalid-assignment] Object of type `list[(Self@__init_subclass__, Interaction[Any], Any, /) -> Coroutine[Any, Any, Any]]` is not assignable to attribute `__action_row_children_items__` of type `list[(Self@ActionRow, 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, Any]` has no attribute `__discord_ui_model_type__`
+ discord/ui/action_row.py:163:26: error[unresolved-attribute] Object of type `(Self@_init_children, Interaction[Any], Any, /) -> Coroutine[Any, Any, Any]` has no attribute `__discord_ui_model_type__`
- discord/ui/action_row.py:163:59: error[unresolved-attribute] Object of type `(Unknown, Interaction[Any], Any, /) -> Coroutine[Any, Any, Any]` has no attribute `__discord_ui_model_kwargs__`
+ discord/ui/action_row.py:163:59: error[unresolved-attribute] Object of type `(Self@_init_children, Interaction[Any], Any, /) -> Coroutine[Any, Any, Any]` has no attribute `__discord_ui_model_kwargs__`
- discord/ui/action_row.py:166:27: error[unresolved-attribute] Object of type `(Unknown, Interaction[Any], Any, /) -> Coroutine[Any, Any, Any]` has no attribute `__name__`
+ discord/ui/action_row.py:166:27: error[unresolved-attribute] Object of type `(Self@_init_children, Interaction[Any], Any, /) -> Coroutine[Any, Any, Any]` has no attribute `__name__`
- discord/ui/container.py:109:77: 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/container.py:109:35: error[invalid-type-form] `ClassVar` cannot contain type variables
- discord/ui/container.py:151:30: error[unresolved-attribute] Object of type `((Unknown, Interaction[Any], Any, /) -> Coroutine[Any, Any, Any]) & ~Item[object]` has no attribute `__discord_ui_model_type__`
+ discord/ui/container.py:151:30: error[unresolved-attribute] Object of type `((Self@_init_children, Interaction[Any], Any, /) -> Coroutine[Any, Any, Any]) & ~Item[object]` has no attribute `__discord_ui_model_type__`
- discord/ui/container.py:151:62: error[unresolved-attribute] Object of type `((Unknown, Interaction[Any], Any, /) -> Coroutine[Any, Any, Any]) & ~Item[object]` has no attribute `__discord_ui_model_kwargs__`
+ discord/ui/container.py:151:62: error[unresolved-attribute] Object of type `((Self@_init_children, Interaction[Any], Any, /) -> Coroutine[Any, Any, Any]) & ~Item[object]` has no attribute `__discord_ui_model_kwargs__`
- discord/ui/container.py:153:31: error[unresolved-attribute] Object of type `((Unknown, Interaction[Any], Any, /) -> Coroutine[Any, Any, Any]) & ~Item[object]` has no attribute `__name__`
+ discord/ui/container.py:153:31: error[unresolved-attribute] Object of type `((Self@_init_children, Interaction[Any], Any, /) -> Coroutine[Any, Any, Any]) & ~Item[object]` has no attribute `__name__`
- discord/ui/container.py:159:41: error[unresolved-attribute] Object of type `((Unknown, Interaction[Any], Any, /) -> Coroutine[Any, Any, Any]) & ~Item[object]` has no attribute `__name__`
+ discord/ui/container.py:159:41: error[unresolved-attribute] Object of type `((Self@_init_children, Interaction[Any], Any, /) -> Coroutine[Any, Any, Any]) & ~Item[object]` has no attribute `__name__`
+ discord/ui/container.py:177:9: error[invalid-assignment] Object of type `dict[str, ((Self@__init_subclass__, Interaction[Any], Any, /) -> Coroutine[Any, Any, Any]) | Item[Any]]` is not assignable to attribute `__container_children_items__` of type `dict[str, ((Self@Container, Interaction[Any], Any, /) -> Coroutine[Any, Any, Any]) | Item[Any]]`
- discord/ui/modal.py:109:55: error[invalid-type-arguments] Type `<special-form 'typing.Self'>` is not assignable to upper bound `BaseView` of type variable `V@Item`
+ discord/ui/modal.py:109:31: error[invalid-type-form] `ClassVar` cannot contain type variables
- discord/ui/view.py:331:16: error[invalid-return-type] Return type does not match returned value: expected `list[Item[Self@children]]`, found `list[Item[Self@__init__]]`
- discord/webhook/async_.py:751:44: error[invalid-argument-type] Argument to function `store_user` is incorrect: Argument type `User | PartialUser` does not satisfy upper bound `ConnectionState[ClientT@ConnectionState]` of type variable `Self`
+ discord/webhook/async_.py:751:44: error[invalid-argument-type] Argument to function `store_user` is incorrect: Expected `ConnectionState[Client]`, found `User | PartialUser`
- Found 532 diagnostics
+ Found 531 diagnostics

strawberry (https://github.com/strawberry-graphql/strawberry)
- strawberry/types/unset.py:18:16: error[invalid-return-type] Return type does not match returned value: expected `Self@__new__`, found `<special-form 'typing.Self'>`
- Found 345 diagnostics
+ Found 344 diagnostics

archinstall (https://github.com/archlinux/archinstall)
+ archinstall/lib/boot.py:17:16: error[invalid-type-form] `ClassVar` cannot contain type variables
- archinstall/lib/applications/application_menu.py:52:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_bluetooth(item: MenuItem) -> str | None`
- archinstall/lib/applications/application_menu.py:58:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_audio(item: MenuItem) -> str | None`
- archinstall/lib/applications/application_menu.py:64:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_print_service(item: MenuItem) -> str | None`
- archinstall/lib/applications/application_menu.py:70:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_power_management(item: MenuItem) -> str | None`
- archinstall/lib/applications/application_menu.py:77:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_firewall(item: MenuItem) -> str | None`
- archinstall/lib/authentication/authentication_menu.py:41:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_root_pwd(item: MenuItem) -> str | None`
- archinstall/lib/authentication/authentication_menu.py:47:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_users(item: MenuItem) -> str | None`
- archinstall/lib/authentication/authentication_menu.py:54:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_u2f_login(item: MenuItem) -> str | None`
- archinstall/lib/boot.py:26:28: error[unresolved-attribute] Special form `typing.Self` has no attribute `instance`
- archinstall/lib/boot.py:30:19: error[unresolved-attribute] Special form `typing.Self` has no attribute `session`
- archinstall/lib/boot.py:31:17: error[unresolved-attribute] Special form `typing.Self` has no attribute `ready`
- archinstall/lib/boot.py:54:3: error[invalid-assignment] Object of type `Self@__enter__` is not assignable to attribute `_active_boot` of type `<special-form 'typing.Self'> | None`
+ archinstall/lib/boot.py:54:3: error[invalid-assignment] Object of type `Self@__enter__` is not assignable to attribute `_active_boot` of type `Self@Boot | None`
- archinstall/lib/bootloader/bootloader_menu.py:50:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_bootloader(item: MenuItem) -> str | None`
- archinstall/lib/bootloader/bootloader_menu.py:58:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_uki(item: MenuItem) -> str | None`
- archinstall/lib/bootloader/bootloader_menu.py:66:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_removable(item: MenuItem) -> str | None`
- archinstall/lib/configuration.py:150:4: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `def preview(item: MenuItem) -> str | None`
- archinstall/lib/configuration.py:155:4: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `def preview(item: MenuItem) -> str | None`
- archinstall/lib/configuration.py:160:4: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `def preview(item: MenuItem) -> str | None`
- archinstall/lib/disk/disk_menu.py:68:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_disk_layouts(item: MenuItem) -> str | None`
- archinstall/lib/disk/disk_menu.py:75:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_lvm_config(item: MenuItem) -> str | None`
- archinstall/lib/disk/disk_menu.py:82:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_disk_encryption(item: MenuItem) -> str | None`
- archinstall/lib/disk/disk_menu.py:90:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_btrfs_snapshots(item: MenuItem) -> str | None`
- archinstall/lib/disk/encryption_menu.py:56:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_type(item: MenuItem) -> str | None`
- archinstall/lib/disk/encryption_menu.py:64:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_password(item: MenuItem) -> str | None`
- archinstall/lib/disk/encryption_menu.py:72:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_iter_time(item: MenuItem) -> str | None`
- archinstall/lib/disk/encryption_menu.py:80:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_partitions(item: MenuItem) -> str | None`
- archinstall/lib/disk/encryption_menu.py:88:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_lvm_vols(item: MenuItem) -> str | None`
- archinstall/lib/disk/encryption_menu.py:96:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_hsm(item: MenuItem) -> str | None`
- archinstall/lib/global_menu.py:65:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_get_menu_options._prev_archinstall_language(item: MenuItem) -> str | None`
- archinstall/lib/global_menu.py:72:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_get_menu_options._prev_locale(item: MenuItem) -> str | None`
- archinstall/lib/global_menu.py:78:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_get_menu_options._prev_mirror_config(item: MenuItem) -> str | None`
- archinstall/lib/global_menu.py:84:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_get_menu_options._prev_disk_config(item: MenuItem) -> str | None`
- archinstall/lib/global_menu.py:92:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_get_menu_options._prev_swap(item: MenuItem) -> str | None`
- archinstall/lib/global_menu.py:99:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_get_menu_options._prev_bootloader_config(item: MenuItem) -> str | None`
- archinstall/lib/global_menu.py:106:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_get_menu_options._prev_kernel(item: MenuItem) -> str | None`
- archinstall/lib/global_menu.py:114:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_get_menu_options._prev_hostname(item: MenuItem) -> str | None`
- archinstall/lib/global_menu.py:120:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_get_menu_options._prev_authentication(item: MenuItem) -> str | None`
- archinstall/lib/global_menu.py:126:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_get_menu_options._prev_profile(item: MenuItem) -> str | None`
- archinstall/lib/global_menu.py:133:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_get_menu_options._prev_applications(item: MenuItem) -> str | None`
- archinstall/lib/global_menu.py:140:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_get_menu_options._prev_network_config(item: MenuItem) -> str | None`
- archinstall/lib/global_menu.py:147:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_get_menu_options._prev_parallel_dw(item: MenuItem) -> str | None`
- archinstall/lib/global_menu.py:154:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_get_menu_options._prev_additional_pkgs(item: MenuItem) -> str | None`
- archinstall/lib/global_menu.py:161:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_get_menu_options._prev_tz(item: MenuItem) -> str | None`
- archinstall/lib/global_menu.py:168:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_get_menu_options._prev_ntp(item: MenuItem) -> str | None`
- archinstall/lib/global_menu.py:182:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_get_menu_options._prev_install_invalid_config(item: MenuItem) -> str | None`
- archinstall/lib/interactions/disk_conf.py:56:4: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `def _preview_device_selection(item: MenuItem) -> str | None`
- archinstall/lib/mirrors.py:393:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_regions(item: MenuItem) -> str`
- archinstall/lib/mirrors.py:400:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_custom_servers(item: MenuItem) -> str | None`
- archinstall/lib/mirrors.py:407:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_additional_repos(item: MenuItem) -> str | None`
- archinstall/lib/mirrors.py:414:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_custom_mirror(item: MenuItem) -> str | None`
- archinstall/lib/profile/profile_menu.py:40:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._preview_profile(item: MenuItem) -> str | None`
- archinstall/lib/profile/profile_menu.py:47:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_gfx(item: MenuItem) -> str | None`
- archinstall/lib/profile/profile_menu.py:57:5: error[invalid-argument-type] Argument is incorrect: Expected `((<special-form 'typing.Self'>, /) -> str | None) | None`, found `bound method Self@_define_menu_options._prev_greeter(item: MenuItem) -> str | None`
- archinstall/tui/curses_menu.py:1050:43: error[invalid-argument-type] Argument is incorrect: Expected `<special-form 'typing.Self'>`, found `(Unknown & ~AlwaysFalsy) | (MenuItem & ~AlwaysFalsy)`
+ archinstall/tui/curses_menu.py:1244:6: error[invalid-type-form] `ClassVar` cannot contain type variables
- archinstall/tui/curses_menu.py:1249:4: error[invalid-assignment] Object of type `Self@__enter__` is not assignable to attribute `_t` of type `<special-form 'typing.Self'> | None`
+ archinstall/tui/curses_menu.py:1249:4: error[invalid-assignment] Object of type `Self@__enter__` is not assignable to attribute `_t` of type `Self@Tui | None`
- archinstall/tui/curses_menu.py:1261:10: error[invalid-return-type] Return type does not match returned value: expected `Self@t`, found `<special-form 'typing.Self'>`
- archinstall/tui/curses_menu.py:1349:4: error[unresolved-attribute] Special form `typing.Self` has no attribute `screen`
+ archinstall/tui/menu_item.py:27:8: error[invalid-type-form] `ClassVar` cannot contain type variables
+ archinstall/tui/menu_item.py:28:7: error[invalid-type-form] `ClassVar` cannot contain type variables
- archinstall/tui/menu_item.py:50:4: error[invalid-assignment] Object of type `Self@yes` is not assignable to attribute `_yes` of type `<special-form 'typing.Self'> | None`
+ archinstall/tui/menu_item.py:50:4: error[invalid-assignment] Object of type `Self@yes` is not assignable to attribute `_yes` of type `Self@MenuItem | None`
- archinstall/tui/menu_item.py:52:10: error[invalid-return-type] Return type does not match returned value: expected `Self@yes`, found `<special-form 'typing.Self'> | None`
- archinstall/tui/menu_item.py:57:4: error[invalid-assignment] Object of type `Self@no` is not assignable to attribute `_no` of type `<special-form 'typing.Self'> | None`
+ archinstall/tui/menu_item.py:57:4: error[invalid-assignment] Object of type `Self@no` is not assignable to attribute `_no` of type `Self@MenuItem | None`
- archinstall/tui/menu_item.py:59:10: error[invalid-return-type] Return type does not match returned value: expected `Self@no`, found `<special-form 'typing.Self'> | None`
- archinstall/tui/ui/components.py:332:40: error[invalid-argument-type] Argument is incorrect: Expected `<special-form 'typing.Self'>`, found `Unknown | MenuItem`
- archinstall/tui/ui/components.py:556:40: error[invalid-argument-type] Argument is incorrect: Expected `<special-form 'typing.Self'>`, found `MenuItem`
- archinstall/tui/ui/components.py:680:37: error[invalid-argument-type] Argument is incorrect: Expected `<special-form 'typing.Self'>`, found `(Unknown & ~AlwaysFalsy) | (MenuItem & ~AlwaysFalsy)`
+ archinstall/tui/ui/menu_item.py:28:8: error[invalid-type-form] `ClassVar` cannot contain type variables
+ archinstall/tui/ui/menu_item.py:29:7: error[invalid-type-form] `ClassVar` cannot contain type variables
- archinstall/tui/ui/menu_item.py:51:4: error[invalid-assignment] Object of type `Self@yes` is not assignable to attribute `_yes` of type `<special-form 'typing.Self'> | None`
+ archinstall/tui/ui/menu_item.py:51:4: error[invalid-assignment] Object of type `Self@yes` is not assignable to attribute `_yes` of type `Self@MenuItem | None`
- archinstall/tui/ui/menu_item.py:53:10: error[invalid-return-type] Return type does not match returned value: expected `Self@yes`, found `<special-form 'typing.Self'> | None`
- archinstall/tui/ui/menu_item.py:58:4: error[invalid-assignment] Object of type `Self@no` is not assignable to attribute `_no` of type `<special-form 'typing.Self'> | None`
+ archinstall/tui/ui/menu_item.py:58:4: error[invalid-assignment] Object of type `Self@no` is not assignable to attribute `_no` of type `Self@MenuItem | None`
- archinstall/tui/ui/menu_item.py:60:10: error[invalid-return-type] Return type does not match returned value: expected `Self@no`, found `<special-form 'typing.Self'> | None`
- Found 127 diagnostics
+ Found 71 diagnostics

manticore (https://github.com/trailofbits/manticore)
- manticore/core/smtlib/constraints.py:81:9: error[invalid-assignment] Object of type `None` is not assignable to attribute `_parent` on type `Unknown | None | Self@__enter__`
+ manticore/core/smtlib/constraints.py:81:9: error[invalid-assignment] Object of type `None` is not assignable to attribute `_parent` on type `Unknown | None | Self@__exit__`

xarray (https://github.com/pydata/xarray)
- xarray/core/treenode.py:88:16: error[invalid-return-type] Return type does not match returned value: expected `Self@parent | None`, found `<special-form 'typing.Self'> | None`
- xarray/core/treenode.py:133:13: error[invalid-assignment] Object of type `dict[str, <special-form 'typing.Self'> | Self@_detach]` is not assignable to attribute `_children` of type `dict[str, <special-form 'typing.Self'>]`
- xarray/core/treenode.py:153:13: error[invalid-assignment] Invalid subscript assignment with key of type `str` and value of type `Self@_attach` on object of type `dict[str, <special-form 'typing.Self'>]`
- xarray/core/treenode.py:154:13: error[invalid-assignment] Object of type `Self@_attach` is not assignable to attribute `_parent` of type `<special-form 'typing.Self'> | None`
- xarray/core/treenode.py:166:16: error[invalid-return-type] Return type does not match returned value: expected `Mapping[str, Self@children]`, found `Frozen[str, <special-form 'typing.Self'>]`
- xarray/core/treenode.py:654:13: error[unresolved-attribute] Special form `typing.Self` has no attribute `orphan`
- Found 1718 diagnostics
+ Found 1712 diagnostics

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/_internal/concurrency/calls.py:215:30: error[invalid-argument-type] Argument is incorrect: Expected `<special-form 'typing.Self'>`, found `Self@_invoke_callbacks`
- src/prefect/_internal/concurrency/services.py:284:32: error[unresolved-attribute] Special form `typing.Self` has no attribute `_drain`
- src/prefect/_internal/concurrency/services.py:313:17: error[invalid-assignment] Invalid subscript assignment with key of type `int` and value of type `Self@instance` on object of type `dict[int, <special-form 'typing.Self'>]`
- src/prefect/_internal/concurrency/services.py:315:20: error[invalid-return-type] Return type does not match returned value: expected `Self@instance`, found `<special-form 'typing.Self'>`
- src/prefect/_waiters.py:243:20: error[invalid-return-type] Return type does not match returned value: expected `Self@instance`, found `<special-form 'typing.Self'> | Unknown`
- src/prefect/cli/transfer/_migratable_resources/automations.py:52:20: error[invalid-return-type] Return type does not match returned value: expected `Self@construct`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/automations.py:54:9: error[invalid-assignment] Invalid subscript assignment with key of type `UUID` and value of type `Self@construct` on object of type `dict[UUID, <special-form 'typing.Self'>]`
- src/prefect/cli/transfer/_migratable_resources/automations.py:62:20: error[invalid-return-type] Return type does not match returned value: expected `MigratableResource[Automation] | None`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/blocks.py:48:20: error[invalid-return-type] Return type does not match returned value: expected `Self@construct`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/blocks.py:50:9: error[invalid-assignment] Invalid subscript assignment with key of type `UUID` and value of type `Self@construct` on object of type `dict[UUID, <special-form 'typing.Self'>]`
- src/prefect/cli/transfer/_migratable_resources/blocks.py:58:20: error[invalid-return-type] Return type does not match returned value: expected `MigratableResource[BlockType] | None`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/blocks.py:102:20: error[invalid-return-type] Return type does not match returned value: expected `Self@construct`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/blocks.py:104:9: error[invalid-assignment] Invalid subscript assignment with key of type `UUID` and value of type `Self@construct` on object of type `dict[UUID, <special-form 'typing.Self'>]`
- src/prefect/cli/transfer/_migratable_resources/blocks.py:112:20: error[invalid-return-type] Return type does not match returned value: expected `MigratableResource[BlockSchema] | None`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/blocks.py:242:20: error[invalid-return-type] Return type does not match returned value: expected `Self@construct`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/blocks.py:244:9: error[invalid-assignment] Invalid subscript assignment with key of type `UUID` and value of type `Self@construct` on object of type `dict[UUID, <special-form 'typing.Self'>]`
- src/prefect/cli/transfer/_migratable_resources/blocks.py:252:20: error[invalid-return-type] Return type does not match returned value: expected `MigratableResource[BlockDocument] | None`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/concurrency_limits.py:50:20: error[invalid-return-type] Return type does not match returned value: expected `Self@construct`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/concurrency_limits.py:52:9: error[invalid-assignment] Invalid subscript assignment with key of type `UUID` and value of type `Self@construct` on object of type `dict[UUID, <special-form 'typing.Self'>]`
- src/prefect/cli/transfer/_migratable_resources/concurrency_limits.py:60:20: error[invalid-return-type] Return type does not match returned value: expected `MigratableResource[GlobalConcurrencyLimitResponse] | None`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/deployments.py:45:20: error[invalid-return-type] Return type does not match returned value: expected `Self@construct`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/deployments.py:47:9: error[invalid-assignment] Invalid subscript assignment with key of type `UUID` and value of type `Self@construct` on object of type `dict[UUID, <special-form 'typing.Self'>]`
- src/prefect/cli/transfer/_migratable_resources/deployments.py:55:20: error[invalid-return-type] Return type does not match returned value: expected `MigratableResource[DeploymentResponse] | None`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/flows.py:39:20: error[invalid-return-type] Return type does not match returned value: expected `Self@construct`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/flows.py:41:9: error[invalid-assignment] Invalid subscript assignment with key of type `UUID` and value of type `Self@construct` on object of type `dict[UUID, <special-form 'typing.Self'>]`
- src/prefect/cli/transfer/_migratable_resources/flows.py:47:20: error[invalid-return-type] Return type does not match returned value: expected `MigratableResource[Flow] | None`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/variables.py:42:20: error[invalid-return-type] Return type does not match returned value: expected `Self@construct`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/variables.py:44:9: error[invalid-assignment] Invalid subscript assignment with key of type `UUID` and value of type `Self@construct` on object of type `dict[UUID, <special-form 'typing.Self'>]`
- src/prefect/cli/transfer/_migratable_resources/variables.py:50:20: error[invalid-return-type] Return type does not match returned value: expected `MigratableResource[Variable] | None`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/work_pools.py:48:20: error[invalid-return-type] Return type does not match returned value: expected `Self@construct`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/work_pools.py:52:13: error[invalid-assignment] Invalid subscript assignment with key of type `UUID` and value of type `Self@construct` on object of type `dict[UUID, <special-form 'typing.Self'>]`
- src/prefect/cli/transfer/_migratable_resources/work_pools.py:58:20: error[invalid-return-type] Return type does not match returned value: expected `MigratableResource[WorkPool] | None`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/work_pools.py:66:16: error[unresolved-attribute] Special form `typing.Self` has no attribute `source_work_pool`
- src/prefect/cli/transfer/_migratable_resources/work_pools.py:67:24: error[invalid-return-type] Return type does not match returned value: expected `MigratableResource[WorkPool] | None`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/work_queues.py:43:20: error[invalid-return-type] Return type does not match returned value: expected `Self@construct`, found `<special-form 'typing.Self'>`
- src/prefect/cli/transfer/_migratable_resources/work_queues.py:45:9: error[invalid-assignment] Invalid subscript assignment with key of type `UUID` and value of type `Self@construct` on object of type `dict[UUID, <special-form 'typing.Self'>]`
- src/prefect/cli/transfer/_migratable_resources/work_queues.py:53:20: error[invalid-return-type] Return type does not match returned value: expected `MigratableResource[WorkQueue] | None`, found `<special-form 'typing.Self'>`
+ src/prefect/concurrency/context.py:12:14: error[invalid-type-form] `ClassVar` cannot contain type variables
+ src/prefect/concurrency/v1/context.py:12:14: error[invalid-type-form] `ClassVar` cannot contain type variables
+ src/prefect/context.py:248:14: error[invalid-type-form] `ClassVar` cannot contain type variables
+ src/prefect/context.py:306:14: error[invalid-type-form] `ClassVar` cannot contain type variables
+ src/prefect/context.py:425:14: error[invalid-type-form] `ClassVar` cannot contain type variables
+ src/prefect/context.py:472:14: error[invalid-type-form] `ClassVar` cannot contain type variables
+ src/prefect/context.py:519:14: error[invalid-type-form] `ClassVar` cannot contain type variables
- src/prefect/context.py:725:16: error[invalid-return-type] Return type does not match returned value: expected `Self@get`, found `Self@get | <special-form 'typing.Self'>`
+ src/prefect/context.py:727:14: error[invalid-type-form] `ClassVar` cannot contain type variables
+ src/prefect/context.py:744:14: error[invalid-type-form] `ClassVar` cannot contain type variables
- src/prefect/server/task_queue.py:52:13: error[invalid-assignment] Invalid subscript assignment with key of type `str` and value of type `Self@for_key` on object of type `dict[str, <special-form 'typing.Self'>]`
- src/prefect/server/task_queue.py:53:16: error[invalid-return-type] Return type does not match returned value: expected `Self@for_key`, found `<special-form 'typing.Self'>`
- src/prefect/task_runs.py:258:20: error[invalid-return-type] Return type does not match returned value: expected `Self@instance`, found `<special-form 'typing.Self'> | Unknown`
+ src/prefect/transactions.py:88:14: error[invalid-type-form] `ClassVar` cannot contain type variables
- src/prefect/transactions.py:218:30: error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `<special-form 'typing.Self'>`, found `Self@add_child`
- src/prefect/transactions.py:251:16: error[invalid-return-type] Return type does not match returned value: expected `Self@get_active | None`, found `None | <special-form 'typing.Self'>`
- src/prefect/transactions.py:267:40: error[invalid-argument-type] Argument to bound method `set` is incorrect: Expected `<special-form 'typing.Self'>`, found `Self@__enter__`
- src/prefect/transactions.py:349:48: error[unresolved-attribute] Special form `typing.Self` has no attribute `commit`
- src/prefect/transactions.py:350:38: error[unresolved-attribute] Special form `typing.Self` has no attribute `commit`
- src/prefect/transactions.py:352:21: error[unresolved-attribute] Special form `typing.Self` has no attribute `commit`
- src/prefect/transactions.py:429:48: error[unresolved-attribute] Special form `typing.Self` has no attribute `rollback`
- src/prefect/transactions.py:430:38: error[unresolved-attribute] Special form `typing.Self` has no attribute `rollback`
- src/prefect/transactions.py:432:21: error[unresolved-attribute] Special form `typing.Self` has no attribute `rollback`
- src/prefect/transactions.py:512:21: error[unresolved-attribute] Special form `typing.Self` has no attribute `commit`
- src/prefect/transactions.py:592:21: error[unresolved-attribute] Special form `typing.Self` has no attribute `rollback`
- src/prefect/transactions.py:614:40: error[invalid-argument-type] Argument to bound method `set` is incorrect: Expected `<special-form 'typing.Self'>`, found `Self@__aenter__`
- Found 5505 diagnostics
+ Found 5462 diagnostics

pywin32 (https://github.com/mhammond/pywin32)
+ win32/Lib/win32timezone.py:832:13: error[invalid-type-form] `ClassVar` cannot contain type variables
- win32/Lib/win32timezone.py:845:13: error[invalid-assignment] Object of type `Self@utc` is not assignable to attribute `_tzutc` of type `<special-form 'typing.Self'> | None`
+ win32/Lib/win32timezone.py:845:13: error[invalid-assignment] Object of type `Self@utc` is not assignable to attribute `_tzutc` of type `Self@TimeZoneInfo | None`
- win32/Lib/win32timezone.py:846:16: error[invalid-return-type] Return type does not match returned value: expected `Self@utc`, found `<special-form 'typing.Self'> | None`

altair (https://github.com/vega/altair)
+ altair/datasets/_reader.py:335:16: error[invalid-argument-type] Argument to bound method `lazy` is incorrect: Argument type `IntoFrameT@Reader` does not satisfy upper bound `LazyFrame[LazyFrameT@LazyFrame]` of type variable `Self`
- Found 1111 diagnostics
+ Found 1112 diagnostics

dd-trace-py (https://github.com/DataDog/dd-trace-py)
- ddtrace/debugging/_products/dynamic_instrumentation.py:58:25: warning[possibly-missing-attribute] Attribute `enabled` may be missing on object of type `Unknown | type[Self@__init__]`
- ddtrace/debugging/_products/exception_replay.py:50:25: warning[possibly-missing-attribute] Attribute `enabled` may be missing on object of type `Unknown | type[Self@__init__]`
- Found 9410 diagnostics
+ Found 9408 diagnostics

django-stubs (https://github.com/typeddjango/django-stubs)
- django-stubs/contrib/admin/options.pyi:173:39: error[invalid-type-arguments] Type `<special-form 'typing.Self'>` is not assignable to upper bound `ModelAdmin[Any]` of type variable `_ModelAdmin`
- django-stubs/contrib/auth/models.pyi:106:35: error[invalid-type-arguments] Type `<special-form 'typing.Self'>` is not assignable to upper bound `AbstractBaseUser` of type variable `_UserType@UserManager`
+ django-stubs/contrib/auth/models.pyi:106:14: error[invalid-type-form] `ClassVar` cannot contain type variables
- django-stubs/contrib/gis/db/backends/oracle/models.pyi:12:31: error[invalid-type-arguments] Type `<special-form 'typing.Self'>` is not assignable to upper bound `Model` of type variable `_T@Manager`
+ django-stubs/contrib/gis/db/backends/oracle/models.pyi:12:14: error[invalid-type-form] `ClassVar` cannot contain type variables
- django-stubs/contrib/gis/db/backends/oracle/models.pyi:26:31: error[invalid-type-arguments] Type `<special-form 'typing.Self'>` is not assignable to upper bound `Model` of type variable `_T@Manager`
+ django-stubs/contrib/gis/db/backends/oracle/models.pyi:26:14: error[invalid-type-form] `ClassVar` cannot contain type variables
- django-stubs/contrib/gis/db/backends/postgis/models.pyi:15:38: error[invalid-type-arguments] Type `<special-form 'typing.Self'>` is not assignable to upper bound `Model` of type variable `_T@Manager`
+ django-stubs/contrib/gis/db/backends/postgis/models.pyi:15:14: error[invalid-type-form] `ClassVar` cannot contain type variables
- django-stubs/contrib/gis/db/backends/postgis/models.pyi:28:38: error[invalid-type-arguments] Type `<special-form 'typing.Self'>` is not assignable to upper bound `Model` of type variable `_T@Manager`
+ django-stubs/contrib/gis/db/backends/postgis/models.pyi:28:14: error[invalid-type-form] `ClassVar` cannot contain type variables
- django-stubs/contrib/gis/db/backends/spatialite/models.pyi:14:38: error[invalid-type-arguments] Type `<special-form 'typing.Self'>` is not assignable to upper bound `Model` of type variable `_T@Manager`
+ django-stubs/contrib/gis/db/backends/spatialite/models.pyi:14:14: error[invalid-type-form] `ClassVar` cannot contain type variables
- django-stubs/contrib/gis/db/backends/spatialite/models.pyi:28:38: error[invalid-type-arguments] Type `<special-form 'typing.Self'>` is not assignable to upper bound `Model` of type variable `_T@Manager`
+ django-stubs/contrib/gis/db/backends/spatialite/models.pyi:28:14: error[invalid-type-form] `ClassVar` cannot contain type variables
- django-stubs/contrib/sessions/base_session.pyi:18:42: error[invalid-type-arguments] Type `<special-form 'typing.Self'>` is not assignable to upper bound `AbstractBaseSession` of type variable `_T@BaseSessionManager`
+ django-stubs/contrib/sessions/base_session.pyi:18:14: error[invalid-type-form] `ClassVar` cannot contain type variables
- django-stubs/db/migrations/recorder.pyi:14:35: error[invalid-type-arguments] Type `<special-form 'typing.Self'>` is not assignable to upper bound `Model` of type variable `_T@Manager`
+ django-stubs/db/migrations/recorder.pyi:14:18: error[invalid-type-form] `ClassVar` cannot contain type variables
- django-stubs/db/models/base.pyi:46:31: error[invalid-type-arguments] Type `<special-form 'typing.Self'>` is not assignable to upper bound `Model` of type variable `_T@Manager`
- django-stubs/db/models/base.pyi:48:29: error[invalid-type-arguments] Type `<special-form 'typing.Self'>` is not assignable to upper bound `Model` of type variable `_M@Options`
+ django-stubs/db/models/base.pyi:46:14: error[invalid-type-form] `ClassVar` cannot contain type variables
+ django-stubs/db/models/base.pyi:48:12: error[invalid-type-form] `ClassVar` cannot contain type variables
- Found 453 diagnostics
+ Found 452 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 535 diagnostics
+ Found 534 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 `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/geometry/point.py:1295:25: warning[possibly-missing-attribute] Attribute `tolist` may be missing on object of type `MatrixBase | Expr`
- 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/integrals/tests/test_heurisch.py:390:26: error[not-subscriptable] Cannot subscript object of type `Expr` with no `__getitem__` method
- 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:1321:16: warning[possibly-missing-attribute] Attribute `diagonalize` may be missing on object of type `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 `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ 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: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[Unknown | MatrixBase, MatrixBase, MatrixBase | 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[MatrixBase | Expr | Unknown, MatrixBase, MatrixBase | Expr | 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 `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ 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_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_matadd.py:36:12: error[unsupported-operator] Operator `+` is not supported between objects of type `MatrixBase` and `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_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_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 `T2'return@call_highest_priority | T1'return@call_highest_priority | 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 `MatrixBase | Expr`
- 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:385:11: error[unsupported-operator] Operator `-` is not supported between objects of type `MatrixBase` and `MatrixBase | Expr | Unknown`
- 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: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:11: error[unsupported-operator] Operator `+` is not supported between objects of type `MatrixBase` and `MatrixBase | Expr | Unknown`
- 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 `(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: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: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 `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ 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: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: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/matrixbase.py:5078:16: error[invalid-return-type] Return type does not match returned value: expected `Self@log`, found `MatrixBase | @Todo | Expr`
+ sympy/matrices/solvers.py:741:12: error[invalid-return-type] Return type does not match returned value: expected `Tmat@_pinv_solve`, found `T2'return@call_highest_priority | T1'return@call_highest_priority`
- 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 `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ 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: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: 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: Expected `MatrixBase`, found `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: Expected `MatrixBase`, found `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/sparse.py:417:16: warning[possibly-missing-attribute] Attribute `inv` may be missing on object of type `MatrixBase | Expr`
- sympy/matrices/tests/test_decompositions.py:23:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/tests/test_decompositions.py:23:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `MatrixBase | Expr`
- sympy/matrices/tests/test_decompositions.py:32:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/tests/test_decompositions.py:32:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `MatrixBase | Expr`
- sympy/matrices/tests/test_decompositions.py:42:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/tests/test_decompositions.py:42:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `MatrixBase | Expr`
- sympy/matrices/tests/test_decompositions.py:51:12: warning[possibly-missing-attribute] Attribute `permute_rows` may be missing on object of type `T2'return@call_highest_priority | T1'retur

... (truncated 1351 lines) ...

@AlexWaygood AlexWaygood added ty Multi-file analysis & type inference ecosystem-analyzer labels Feb 5, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 5, 2026

Merging this PR will not alter performance

✅ 24 untouched benchmarks
⏩ 30 skipped benchmarks1


Comparing charlie/self-test (53e246a) with main (8aba480)

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.

@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 5, 2026

ecosystem-analyzer results

Lint rule Added Removed Changed
unresolved-attribute 934 16 7
invalid-argument-type 15 70 19
possibly-missing-attribute 58 13 0
invalid-return-type 2 41 3
invalid-assignment 2 22 10
invalid-type-form 33 0 0
invalid-type-arguments 0 18 0
unused-type-ignore-comment 0 3 0
redundant-cast 2 0 0
Total 1,046 183 39

Full report with detailed diff (timing results)

@charliermarsh charliermarsh changed the title [ty] Retry bind typing.Self in class attributes and assignment [ty] Bind typing.Self in class attributes and assignment Feb 6, 2026
@charliermarsh charliermarsh marked this pull request as ready for review February 6, 2026 06:56
@sharkdp sharkdp self-assigned this Feb 6, 2026
@sharkdp
Copy link
Contributor

sharkdp commented Feb 6, 2026

Just adding a note that the 992 new false positives on zulip are due to missing django support.

Copy link
Contributor

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

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

Finishing my first review here, as I would first like to understand if we really need the supports_self_binding filtering.

@charliermarsh
Copy link
Member Author

For completeness: I also had #22487 which was written by Claude and iterated-on over the course of a few days, but I found it hard to understand and this is my attempt to simplify the solution.

Copy link
Contributor

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

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

I have some more questions, but the general direction definitely looks good — thank you for the updates.

self_typevar_owner_class_literal(db, other),
) {
return left == right && self.paramspec_attr(db) == other.paramspec_attr(db);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

With this change, we will now also consider Self@method1 and Self@method2 the same typevar. Can this cause any problems?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is correct, e.g. given:

class Foo:
    def method1(self) -> Self: ...
    def method2(self) -> Self: ...

    def combined(self) -> Self:
        if condition:
            return self.method1()   # Self@method1
        else:
            return self.method2()   # Self@method2

You want Self@method1 | Self@method2 to simplify to Self.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we generate the type Self@method1 | Self@method2 here. Inferring the type for self.method1() will already bind Self@method1 and return Foo. This code works fine on main.

Interested in @dcreager's opinion here.

Copy link
Member Author

Choose a reason for hiding this comment

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

(Increasingly think you're right, and that this was introduced in a prior iteration but subsequently made redundant. Going to try removing.)

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like it works, cool! In that case — no dcreager opinion needed 😄. Let's merge!

@charliermarsh charliermarsh marked this pull request as draft February 10, 2026 14:46
@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 10, 2026

Memory usage report

Summary

Project Old New Diff Outcome
prefect 677.37MB 678.97MB +0.2% (1.61MB)
sphinx 269.22MB 270.11MB +0.3% (911.42kB)
trio 118.20MB 118.31MB +0.1% (110.82kB)
flake8 49.45MB 49.45MB +0.0% (216.00B)

Significant changes

Click to expand detailed breakdown

prefect

Name Old New Diff Outcome
FunctionType 8.35MB 8.66MB +3.8% (321.70kB)
FunctionType<'db>::last_definition_signature_ 721.98kB 914.63kB +26.7% (192.64kB)
FunctionType<'db>::signature_ 3.90MB 4.07MB +4.2% (169.19kB)
is_redundant_with_impl::interned_arguments 5.99MB 6.14MB +2.6% (156.92kB)
Type<'db>::member_lookup_with_policy_ 15.11MB 15.24MB +0.9% (133.35kB)
UnionType 3.77MB 3.87MB +2.6% (98.78kB)
is_redundant_with_impl 5.87MB 5.95MB +1.4% (86.88kB)
BoundMethodType 1.31MB 1.38MB +5.3% (71.33kB)
StaticClassLiteral<'db>::try_mro_ 5.94MB 6.01MB +1.2% (71.27kB)
Type<'db>::class_member_with_policy_ 16.80MB 16.86MB +0.3% (58.66kB)
Type<'db>::try_call_dunder_get_ 11.16MB 11.21MB +0.4% (44.32kB)
Specialization 2.43MB 2.47MB +1.5% (36.58kB)
Type<'db>::apply_specialization_::interned_arguments 2.82MB 2.86MB +1.2% (35.47kB)
Type<'db>::apply_specialization_ 3.74MB 3.77MB +0.9% (33.70kB)
check_file_impl 16.59MB 16.56MB -0.2% (28.70kB)
... 40 more

sphinx

Name Old New Diff Outcome
FunctionType 3.17MB 3.38MB +6.6% (214.48kB)
FunctionType<'db>::last_definition_signature_ 227.89kB 368.79kB +61.8% (140.90kB)
is_redundant_with_impl::interned_arguments 2.61MB 2.74MB +4.9% (129.94kB)
FunctionType<'db>::signature_ 2.30MB 2.41MB +4.8% (112.18kB)
Type<'db>::member_lookup_with_policy_ 6.38MB 6.48MB +1.5% (99.97kB)
UnionType 1.56MB 1.65MB +5.2% (82.69kB)
is_redundant_with_impl 2.10MB 2.17MB +3.3% (70.88kB)
BoundMethodType 714.30kB 773.36kB +8.3% (59.06kB)
BoundMethodType<'db>::into_callable_type_ 297.56kB 299.24kB +0.6% (1.68kB)
class_mro_literals 0.00B 660.00B +660.00B (new)
Type<'db>::apply_specialization_::interned_arguments 1.47MB 1.47MB -0.0% (640.00B)
Type<'db>::apply_specialization_ 1.74MB 1.74MB -0.0% (448.00B)
infer_scope_types_impl 17.47MB 17.47MB +0.0% (360.00B)
infer_expression_types_impl 21.26MB 21.26MB -0.0% (240.00B)
infer_definition_types 23.34MB 23.34MB -0.0% (60.00B)
... 1 more

trio

Name Old New Diff Outcome
FunctionType 1.54MB 1.57MB +2.1% (32.82kB)
FunctionType<'db>::signature_ 1.10MB 1.11MB +1.4% (16.16kB)
FunctionType<'db>::last_definition_signature_ 245.68kB 261.22kB +6.3% (15.54kB)
is_redundant_with_impl::interned_arguments 556.36kB 570.45kB +2.5% (14.09kB)
Type<'db>::member_lookup_with_policy_ 1.74MB 1.75MB +0.7% (13.21kB)
UnionType 335.98kB 344.95kB +2.7% (8.97kB)
is_redundant_with_impl 486.07kB 493.76kB +1.6% (7.69kB)
BoundMethodType 188.05kB 194.45kB +3.4% (6.41kB)
Type<'db>::apply_specialization_::interned_arguments 667.66kB 665.39kB -0.3% (2.27kB)
Type<'db>::apply_specialization_ 788.50kB 786.49kB -0.3% (2.01kB)
class_mro_literals 0.00B 1016.00B +1016.00B (new)
Specialization 481.08kB 480.14kB -0.2% (960.00B)
BoundMethodType<'db>::into_callable_type_ 81.52kB 81.88kB +0.4% (372.00B)
infer_expression_types_impl 5.60MB 5.60MB -0.0% (108.00B)
infer_scope_types_impl 5.56MB 5.56MB -0.0% (96.00B)
... 2 more

flake8

Name Old New Diff Outcome
BoundMethodType<'db>::into_callable_type_ 29.37kB 29.58kB +0.7% (216.00B)

@charliermarsh charliermarsh marked this pull request as ready for review February 10, 2026 15:50
@charliermarsh charliermarsh marked this pull request as draft February 10, 2026 19:15
@charliermarsh charliermarsh marked this pull request as ready for review February 10, 2026 19:31
@AlexWaygood AlexWaygood removed their request for review February 10, 2026 19:34
Copy link
Contributor

@sharkdp sharkdp 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!

Comment on lines +665 to +669
class Linkable(Protocol):
next_node: Self

def advance(self) -> Self:
return self.next_node
Copy link
Contributor

Choose a reason for hiding this comment

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

This passes on main as well. But if you try to access the attribute like this:

def _(linkable: Linkable):
    reveal_type(linkable.next_node)

we get @Todo(type[T] for protocols). We don't have to fix this TODO here, but I'm a bit surprised that other attributes can be accessed without problems (see below), so this might be worth investigating?

class Linkable(Protocol):
    next_node: Self
    other_attribute: int


def _(linkable: Linkable):
    reveal_type(linkable.next_node)  # revealed: @Todo(type[T] for protocols)
    reveal_type(linkable.other_attribute)  # revealed: int

I think we should add a test like

Suggested change
class Linkable(Protocol):
next_node: Self
def advance(self) -> Self:
return self.next_node
class Linkable(Protocol):
next_node: Self
def advance(self) -> Self:
return self.next_node
def _(l: Linkable) -> None:
# TODO: Should be `Linkable`
reveal_type(l.next_node) # revealed: @Todo(type[T] for protocols)

self_typevar_owner_class_literal(db, other),
) {
return left == right && self.paramspec_attr(db) == other.paramspec_attr(db);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we generate the type Self@method1 | Self@method2 here. Inferring the type for self.method1() will already bind Self@method1 and return Foo. This code works fine on main.

Interested in @dcreager's opinion here.

@sharkdp sharkdp merged commit 4d39967 into main Feb 11, 2026
50 checks passed
@sharkdp sharkdp deleted the charlie/self-test branch February 11, 2026 14:16
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

3 participants