Skip to content

[ty] Fix ParamSpec defaults and alias variance#24479

Draft
charliermarsh wants to merge 2 commits intomainfrom
charlie/variance
Draft

[ty] Fix ParamSpec defaults and alias variance#24479
charliermarsh wants to merge 2 commits intomainfrom
charlie/variance

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

@charliermarsh charliermarsh commented Apr 8, 2026

Summary

We now treat typing_extensions.ParamSpec defaults like typing.ParamSpec defaults, which I think was an oversight.

I've also included a fix for callable signature variance inference which fell out of #24319.

@astral-sh-bot astral-sh-bot Bot added the ty Multi-file analysis & type inference label Apr 8, 2026
@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Apr 8, 2026

Typing conformance results improved 🎉

The percentage of diagnostics emitted that were expected errors increased from 87.72% to 87.81%. The percentage of expected errors that received a diagnostic held steady at 82.85%. The number of fully passing files held steady at 74/132.

Summary

How are test cases classified?

Each test case represents one expected error annotation or a group of annotations sharing a tag. Counts are per test case, not per diagnostic — multiple diagnostics on the same line count as one. Required annotations (E) are true positives when ty flags the expected location and false negatives when it does not. Optional annotations (E?) are true positives when flagged but true negatives (not false negatives) when not. Tagged annotations (E[tag]) require ty to flag exactly one of the tagged lines; tagged multi-annotations (E[tag+]) allow any number up to the tag count. Flagging unexpected locations counts as a false positive.

Metric Old New Diff Outcome
True Positives 879 879 +0
False Positives 123 122 -1 ⏬ (✅)
False Negatives 182 182 +0
Total Diagnostics 1052 1051 -1
Precision 87.72% 87.81% +0.09% ⏫ (✅)
Recall 82.85% 82.85% +0.00%
Passing Files 74/132 74/132 +0

Test file breakdown

1 file altered
File True Positives False Positives False Negatives Status
generics_defaults.py 5 7 (-1) ✅ 1 📈 Improving
Total (all files) 879 122 (-1) ✅ 182 74/132

False positives removed (1)

1 diagnostic
Test case Diff

generics_defaults.py:122

-error[type-assertion-failure] Type `(**DefaultP@Class_ParamSpec) -> None` does not match asserted type `(str, int, /) -> None`

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Apr 8, 2026

Memory usage report

Summary

Project Old New Diff Outcome
sphinx 264.61MB 264.61MB +0.00% (2.27kB)
flake8 48.00MB 48.00MB -
trio 117.65MB 117.65MB -
prefect 716.25MB 705.77MB -1.46% (10.48MB) ⬇️

Significant changes

Click to expand detailed breakdown

sphinx

Name Old New Diff Outcome
is_redundant_with_impl::interned_arguments 2.01MB 2.01MB +0.03% (616.00B)
IntersectionType 872.56kB 873.15kB +0.07% (600.00B)
is_redundant_with_impl 1.77MB 1.77MB +0.02% (360.00B)
CallableType 1.11MB 1.11MB +0.03% (360.00B)
Type<'db>::apply_specialization_ 1.65MB 1.65MB +0.01% (240.00B)
Type<'db>::member_lookup_with_policy_ 6.54MB 6.54MB +0.00% (144.00B)

prefect

Name Old New Diff Outcome
infer_expression_types_impl 62.11MB 59.06MB -4.92% (3.05MB) ⬇️
infer_expression_type_impl 13.32MB 11.17MB -16.18% (2.16MB) ⬇️
infer_definition_types 89.60MB 87.67MB -2.15% (1.93MB) ⬇️
StaticClassLiteral<'db>::implicit_attribute_inner_ 10.00MB 8.83MB -11.71% (1.17MB) ⬇️
all_narrowing_constraints_for_expression 7.17MB 6.51MB -9.21% (675.84kB) ⬇️
GenericAlias<'db>::variance_of_ 587.23kB 51.47kB -91.24% (535.76kB) ⬇️
all_negative_narrowing_constraints_for_expression 2.63MB 2.17MB -17.49% (471.32kB) ⬇️
FunctionType<'db>::signature_ 4.01MB 3.77MB -6.16% (253.41kB) ⬇️
infer_deferred_types 14.41MB 14.31MB -0.69% (101.47kB) ⬇️
Type<'db>::member_lookup_with_policy_ 16.37MB 16.27MB -0.57% (94.97kB) ⬇️
is_redundant_with_impl 5.51MB 5.47MB -0.71% (40.27kB) ⬇️
is_redundant_with_impl::interned_arguments 5.42MB 5.46MB +0.68% (37.90kB) ⬇️
infer_scope_types_impl 54.08MB 54.04MB -0.07% (37.18kB) ⬇️
Type<'db>::apply_specialization_ 3.66MB 3.62MB -0.99% (37.05kB) ⬇️
FunctionType<'db>::last_definition_signature_ 795.37kB 766.37kB -3.65% (28.99kB) ⬇️
... 43 more

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Apr 8, 2026

ecosystem-analyzer results

Lint rule Added Removed Changed
invalid-argument-type 90 1 0
invalid-await 40 3 0
invalid-assignment 6 0 11
invalid-return-type 12 0 1
unresolved-attribute 0 0 10
call-top-callable 8 0 0
call-non-callable 1 0 0
invalid-method-override 1 0 0
missing-argument 1 0 0
no-matching-overload 1 0 0
unused-type-ignore-comment 0 1 0
Total 160 5 22

Changes in flaky projects detected. Raw diff output excludes flaky projects; see the HTML report for details.

Raw diff (70 changes)
antidote (https://github.com/Finistere/antidote)
- src/antidote/core/_inject.py:295:36 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `(type[Unknown], /, *args: object, **kwargs: object) -> object`, found `Top[(...) -> object]`
- src/antidote/core/_injection.py:298:9 error[unresolved-attribute] Object of type `((...) -> object) & ~staticmethod[Top[(...)], object] & ~Top[classmethod[Unknown, Top[(...)], object]]` has no attribute `__qualname__`
+ src/antidote/core/_injection.py:298:9 error[unresolved-attribute] Object of type `((...) -> object) & ~staticmethod[(*args: object, **kwargs: object), object] & ~Top[classmethod[Unknown, (*args: object, **kwargs: object), object]]` has no attribute `__qualname__`
- src/antidote/core/_injection.py:298:30 error[unresolved-attribute] Object of type `((...) -> object) & ~staticmethod[Top[(...)], object] & ~Top[classmethod[Unknown, Top[(...)], object]]` has no attribute `__name__`
+ src/antidote/core/_injection.py:298:30 error[unresolved-attribute] Object of type `((...) -> object) & ~staticmethod[(*args: object, **kwargs: object), object] & ~Top[classmethod[Unknown, (*args: object, **kwargs: object), object]]` has no attribute `__name__`
- src/antidote/core/_injection.py:302:17 error[unresolved-attribute] Object of type `((...) -> object) & ~staticmethod[Top[(...)], object] & ~Top[classmethod[Unknown, Top[(...)], object]] & ~MethodType` has no attribute `__qualname__`
+ src/antidote/core/_injection.py:302:17 error[unresolved-attribute] Object of type `((...) -> object) & ~staticmethod[(*args: object, **kwargs: object), object] & ~Top[classmethod[Unknown, (*args: object, **kwargs: object), object]] & ~MethodType` has no attribute `__qualname__`
- src/antidote/core/_injection.py:302:42 error[unresolved-attribute] Object of type `((...) -> object) & ~staticmethod[Top[(...)], object] & ~Top[classmethod[Unknown, Top[(...)], object]] & ~MethodType` has no attribute `__name__`
+ src/antidote/core/_injection.py:302:42 error[unresolved-attribute] Object of type `((...) -> object) & ~staticmethod[(*args: object, **kwargs: object), object] & ~Top[classmethod[Unknown, (*args: object, **kwargs: object), object]] & ~MethodType` has no attribute `__name__`

anyio (https://github.com/agronholm/anyio)
+ src/anyio/functools.py:139:13 error[no-matching-overload] No overload of bound method `pop` matches arguments
+ src/anyio/functools.py:167:27 error[invalid-argument-type] Method `__getitem__` of type `bound method WeakKeyDictionary[AsyncLRUCacheWrapper[(...), Any], OrderedDict[Hashable, tuple[_InitialMissingType, Lock, int | float | None] | tuple[Any, None, int | float | None]]].__getitem__(key: AsyncLRUCacheWrapper[(...), Any]) -> OrderedDict[Hashable, tuple[_InitialMissingType, Lock, int | float | None] | tuple[Any, None, int | float | None]]` cannot be called with key of type `Self@__call__` on object of type `WeakKeyDictionary[AsyncLRUCacheWrapper[(...), Any], OrderedDict[Hashable, tuple[_InitialMissingType, Lock, int | float | None] | tuple[Any, None, int | float | None]]]`
+ src/anyio/functools.py:169:27 error[invalid-assignment] Invalid subscript assignment with key of type `Self@__call__` and value of type `OrderedDict[Hashable, tuple[_InitialMissingType, Lock, int | float | None] | tuple[Any, None, int | float | None]]` on object of type `WeakKeyDictionary[AsyncLRUCacheWrapper[(...), Any], OrderedDict[Hashable, tuple[_InitialMissingType, Lock, int | float | None] | tuple[Any, None, int | float | None]]]`
+ src/anyio/functools.py:226:37 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `AsyncLRUCacheWrapper[(...), Unknown]`, found `Self@__get__`
+ src/anyio/functools.py:228:16 error[invalid-return-type] Return type does not match returned value: expected `_LRUMethodWrapper[T@AsyncLRUCacheWrapper]`, found `_LRUMethodWrapper[T@_LRUMethodWrapper]`

core (https://github.com/home-assistant/core)
+ homeassistant/components/harmony/select.py:70:21 error[invalid-argument-type] Argument is incorrect: Expected `ActivityCallback`, found `HassJob[(activity_info: tuple[Unknown, ...]), None]`
+ homeassistant/components/harmony/select.py:71:21 error[invalid-argument-type] Argument is incorrect: Expected `ActivityCallback`, found `HassJob[(activity_info: tuple[Unknown, ...]), None]`
+ homeassistant/helpers/chat_session.py:85:13 error[invalid-argument-type] Argument to function `async_call_later` is incorrect: Expected `HassJob[(datetime, /), Coroutine[Any, Any, None] | None] | ((datetime, /) -> Coroutine[Any, Any, None] | None)`, found `Unknown | HassJob[(now: datetime), None]`
+ homeassistant/auth/__init__.py:568:13 error[invalid-argument-type] Argument to function `async_track_point_in_utc_time` is incorrect: Expected `HassJob[(datetime, /), Coroutine[Any, Any, None] | None] | ((datetime, /) -> Coroutine[Any, Any, None] | None)`, found `Unknown | HassJob[(_: datetime | None = None), None]`
+ homeassistant/components/bluetooth/__init__.py:199:13 error[invalid-argument-type] Argument to function `async_call_later` is incorrect: Expected `HassJob[(datetime, /), Coroutine[Any, Any, None] | None] | ((datetime, /) -> Coroutine[Any, Any, None] | None)`, found `HassJob[(now: datetime), CoroutineType[Any, Any, None]]`
+ homeassistant/components/bond/entity.py:192:13 error[invalid-argument-type] Argument to function `async_call_later` is incorrect: Expected `HassJob[(datetime, /), Coroutine[Any, Any, None] | None] | ((datetime, /) -> Coroutine[Any, Any, None] | None)`, found `Unknown | HassJob[(now: datetime), None]`
+ homeassistant/components/cloud/client.py:189:50 error[invalid-argument-type] Argument to function `async_call_later` is incorrect: Expected `HassJob[(datetime, /), Coroutine[Any, Any, None] | None] | ((datetime, /) -> Coroutine[Any, Any, None] | None)`, found `HassJob[(_: Any), CoroutineType[Any, Any, None]]`
+ homeassistant/components/google_assistant/report_state.py:65:44 error[invalid-argument-type] Argument to function `async_call_later` is incorrect: Expected `HassJob[(datetime, /), Coroutine[Any, Any, None] | None] | ((datetime, /) -> Coroutine[Any, Any, None] | None)`, found `HassJob[(now=None), CoroutineType[Any, Any, Unknown]]`
+ homeassistant/components/hassio/__init__.py:440:17 error[invalid-argument-type] Argument to function `async_call_later` is incorrect: Expected `HassJob[(datetime, /), Coroutine[Any, Any, None] | None] | ((datetime, /) -> Coroutine[Any, Any, None] | None)`, found `HassJob[(_: datetime | None = None), None]`
+ homeassistant/components/hdmi_cec/__init__.py:191:51 error[invalid-argument-type] Argument is incorrect: Expected `HassJob[(datetime, /), Coroutine[Any, Any, None] | None] | ((datetime, /) -> Coroutine[Any, Any, None] | None)`, found `HassJob[(now=None), Unknown]`
+ homeassistant/components/hdmi_cec/__init__.py:202:64 error[invalid-argument-type] Argument to function `async_call_later` is incorrect: Expected `HassJob[(datetime, /), Coroutine[Any, Any, None] | None] | ((datetime, /) -> Coroutine[Any, Any, None] | None)`, found `HassJob[(now=None), Unknown]`
+ homeassistant/components/ld2410_ble/coordinator.py:74:46 error[invalid-argument-type] Argument to function `async_call_later` is incorrect: Expected `HassJob[(datetime, /), Coroutine[Any, Any, None] | None] | ((datetime, /) -> Coroutine[Any, Any, None] | None)`, found `Unknown | HassJob[(_now: datetime), None]`
+ homeassistant/components/nasweb/coordinator.py:178:13 error[invalid-argument-type] Argument to function `async_call_at` is incorrect: Expected `HassJob[(datetime, /), Coroutine[Any, Any, None] | None] | ((datetime, /) -> Coroutine[Any, Any, None] | None)`, found `Unknown | HassJob[(now: datetime), CoroutineType[Any, Any, None]]`
+ homeassistant/components/onvif/event_manager.py:513:35 error[invalid-argument-type] Argument to function `async_call_later` is incorrect: Expected `HassJob[(datetime, /), Coroutine[Any, Any, None] | None] | ((datetime, /) -> Coroutine[Any, Any, None] | None)`, found `Unknown | HassJob[(_now: datetime | None = None), None]`
+ homeassistant/components/reolink/host.py:827:56 error[invalid-argument-type] Argument to function `async_call_later` is incorrect: Expected `HassJob[(datetime, /), Coroutine[Any, Any, None] | None] | ((datetime, /) -> Coroutine[Any, Any, None] | None)`, found `Unknown | HassJob[(*_: Any), CoroutineType[Any, Any, None]]`
+ homeassistant/components/rflink/__init__.py:270:56 error[invalid-argument-type] Argument to function `async_call_later` is incorrect: Expected `HassJob[(datetime, /), Coroutine[Any, Any, None] | None] | ((datetime, /) -> Coroutine[Any, Any, None] | None)`, found `HassJob[(_: Exception | None = None), None]`
+ homeassistant/components/tts/__init__.py:663:13 error[invalid-argument-type] Argument to function `async_call_later` is incorrect: Expected `HassJob[(datetime, /), Coroutine[Any, Any, None] | None] | ((datetime, /) -> Coroutine[Any, Any, None] | None)`, found `Unknown | HassJob[(_now: datetime), None]`
+ homeassistant/helpers/event.py:1491:48 error[invalid-argument-type] Argument to function `async_track_point_in_utc_time` is incorrect: Expected `HassJob[(datetime, /), Coroutine[Any, Any, None] | None] | ((datetime, /) -> Coroutine[Any, Any, None] | None)`, found `HassJob[(utc_now: datetime), None]`

discord.py (https://github.com/Rapptz/discord.py)
+ discord/app_commands/commands.py:748:16 error[invalid-return-type] Return type does not match returned value: expected `Command[Unknown, (...), Unknown]`, found `Self@_copy_with`
+ discord/app_commands/commands.py:761:94 error[invalid-argument-type] Argument to bound method `_checked_translate` is incorrect: Expected `TranslationContext[Literal[TranslationContextLocation.command_name], Command[Any, (...), Any] | ContextMenu] | TranslationContext[Literal[TranslationContextLocation.command_description], Command[Any, (...), Any]] | TranslationContext[Literal[TranslationContextLocation.group_name, TranslationContextLocation.group_description], Group] | ... omitted 3 union elements`, found `TranslationContext[_L@TranslationContext, _D@TranslationContext]`
+ discord/app_commands/commands.py:766:101 error[invalid-argument-type] Argument to bound method `_checked_translate` is incorrect: Expected `TranslationContext[Literal[TranslationContextLocation.command_name], Command[Any, (...), Any] | ContextMenu] | TranslationContext[Literal[TranslationContextLocation.command_description], Command[Any, (...), Any]] | TranslationContext[Literal[TranslationContextLocation.group_name, TranslationContextLocation.group_description], Group] | ... omitted 3 union elements`, found `TranslationContext[_L@TranslationContext, _D@TranslationContext]`
+ discord/app_commands/commands.py:773:77 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Command[Any, (...), Any]`, found `Self@get_translated_payload`
+ discord/app_commands/commands.py:847:52 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Command[Any, (...), Any] | ContextMenu | Group`, found `Self@_transform_arguments`
+ discord/app_commands/commands.py:873:38 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Command[Any, (...), Any] | ContextMenu`, found `Self@_do_call`
+ discord/app_commands/commands.py:877:38 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Command[Any, (...), Any] | ContextMenu`, found `Self@_do_call`
+ discord/app_commands/commands.py:899:48 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Command[Any, (...), Any] | ContextMenu | Group`, found `Self@_invoke_autocomplete`
+ discord/app_commands/commands.py:902:44 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Command[Any, (...), Any] | ContextMenu | Group`, found `Self@_invoke_autocomplete`
+ discord/app_commands/commands.py:944:30 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Command[Any, (...), Any]`, found `Self@parameters`
+ discord/app_commands/commands.py:965:38 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Command[Any, (...), Any]`, found `Self@get_parameter`
+ discord/app_commands/commands.py:2014:20 error[invalid-return-type] Return type does not match returned value: expected `Command[GroupT@decorator, P@decorator, T@decorator]`, found `Command[Unknown, (...), Unknown]`
- discord/app_commands/errors.py:453:95 error[unresolved-attribute] Object of type `Top[(...) -> Coroutine[Any, Any, object]]` has no attribute `__qualname__`
+ discord/app_commands/errors.py:453:95 error[unresolved-attribute] Object of type `((object, Interaction[Any], /, *args: object, **kwargs: object) -> Coroutine[Any, Any, object]) | ((Interaction[Any], /, *args: object, **kwargs: object) -> Coroutine[Any, Any, object]) | ((Any, Interaction[Any], /, *args: Any, **kwargs: Any) -> Coroutine[Any, Any, Any]) | ((Interaction[Any], /, *args: Any, **kwargs: Any) -> Coroutine[Any, Any, Any])` has no attribute `__qualname__`
+ discord/app_commands/tree.py:932:20 error[invalid-return-type] Return type does not match returned value: expected `Command[Group, P@decorator, T@decorator]`, found `Command[Unknown, (...), Unknown]`
+ discord/ext/commands/core.py:958:9 error[invalid-assignment] Object of type `Self@prepare` is not assignable to attribute `command` of type `Command[Any, (...), Any] | None`
+ discord/ext/commands/core.py:1067:9 error[invalid-assignment] Object of type `Self@reinvoke` is not assignable to attribute `command` of type `Command[Any, (...), Any] | None`
+ discord/ext/commands/core.py:1304:9 error[invalid-assignment] Object of type `Self@can_run` is not assignable to attribute `command` of type `Command[Any, (...), Any] | None`
+ discord/ext/commands/core.py:1691:13 error[invalid-assignment] Object of type `Self@reinvoke` is not assignable to attribute `command` of type `Command[Any, (...), Any] | None`
- discord/ext/commands/core.py:1942:17 error[invalid-assignment] Object of type `list[Unknown]` is not assignable to attribute `__commands_checks__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, Top[(...)], Unknown]] & ~<Protocol with members '__commands_checks__'>`
+ discord/ext/commands/core.py:1942:17 error[invalid-assignment] Object of type `list[Unknown]` is not assignable to attribute `__commands_checks__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, (...), Unknown]] & ~<Protocol with members '__commands_checks__'>`
- discord/ext/commands/core.py:1944:13 error[unresolved-attribute] Object of type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, Top[(...)], Unknown]]` has no attribute `__commands_checks__`
+ discord/ext/commands/core.py:1944:13 error[unresolved-attribute] Object of type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, (...), Unknown]]` has no attribute `__commands_checks__`
- discord/ext/commands/core.py:2365:17 error[invalid-assignment] Object of type `list[Unknown]` is not assignable to attribute `__commands_checks__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, Top[(...)], Unknown]] & ~<Protocol with members '__commands_checks__'>`
+ discord/ext/commands/core.py:2365:17 error[invalid-assignment] Object of type `list[Unknown]` is not assignable to attribute `__commands_checks__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, (...), Unknown]] & ~<Protocol with members '__commands_checks__'>`
- discord/ext/commands/core.py:2367:13 error[unresolved-attribute] Object of type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, Top[(...)], Unknown]]` has no attribute `__commands_checks__`
+ discord/ext/commands/core.py:2367:13 error[unresolved-attribute] Object of type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, (...), Unknown]]` has no attribute `__commands_checks__`
- discord/ext/commands/core.py:2368:13 error[invalid-assignment] Object of type `Literal[True]` is not assignable to attribute `__discord_app_commands_guild_only__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, Top[(...)], Unknown]]`
+ discord/ext/commands/core.py:2368:13 error[invalid-assignment] Object of type `Literal[True]` is not assignable to attribute `__discord_app_commands_guild_only__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, (...), Unknown]]`
- discord/ext/commands/core.py:2440:17 error[invalid-assignment] Object of type `list[Unknown]` is not assignable to attribute `__commands_checks__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, Top[(...)], Unknown]] & ~<Protocol with members '__commands_checks__'>`
+ discord/ext/commands/core.py:2440:17 error[invalid-assignment] Object of type `list[Unknown]` is not assignable to attribute `__commands_checks__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, (...), Unknown]] & ~<Protocol with members '__commands_checks__'>`
- discord/ext/commands/core.py:2442:13 error[unresolved-attribute] Object of type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, Top[(...)], Unknown]]` has no attribute `__commands_checks__`
+ discord/ext/commands/core.py:2442:13 error[unresolved-attribute] Object of type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, (...), Unknown]]` has no attribute `__commands_checks__`
- discord/ext/commands/core.py:2443:13 error[invalid-assignment] Object of type `Literal[True]` is not assignable to attribute `__discord_app_commands_is_nsfw__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, Top[(...)], Unknown]]`
+ discord/ext/commands/core.py:2443:13 error[invalid-assignment] Object of type `Literal[True]` is not assignable to attribute `__discord_app_commands_is_nsfw__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, (...), Unknown]]`
- discord/ext/commands/core.py:2499:13 error[invalid-assignment] Object of type `CooldownMapping[Context[Any]]` is not assignable to attribute `__commands_cooldown__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, Top[(...)], Unknown]]`
+ discord/ext/commands/core.py:2499:13 error[invalid-assignment] Object of type `CooldownMapping[Context[Any]]` is not assignable to attribute `__commands_cooldown__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, (...), Unknown]]`
- discord/ext/commands/core.py:2547:13 error[invalid-assignment] Object of type `DynamicCooldownMapping[Context[Any]]` is not assignable to attribute `__commands_cooldown__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, Top[(...)], Unknown]]`
+ discord/ext/commands/core.py:2547:13 error[invalid-assignment] Object of type `DynamicCooldownMapping[Context[Any]]` is not assignable to attribute `__commands_cooldown__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, (...), Unknown]]`
- discord/ext/commands/core.py:2582:13 error[invalid-assignment] Object of type `MaxConcurrency` is not assignable to attribute `__commands_max_concurrency__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, Top[(...)], Unknown]]`
+ discord/ext/commands/core.py:2582:13 error[invalid-assignment] Object of type `MaxConcurrency` is not assignable to attribute `__commands_max_concurrency__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, (...), Unknown]]`
- discord/ext/commands/core.py:2634:13 error[invalid-assignment] Object of type `((CogT@before_invoke, ContextT@before_invoke, /) -> Coroutine[Any, Any, Any]) | ((ContextT@before_invoke, /) -> Coroutine[Any, Any, Any])` is not assignable to attribute `__before_invoke__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, Top[(...)], Unknown]]`
+ discord/ext/commands/core.py:2634:13 error[invalid-assignment] Object of type `((CogT@before_invoke, ContextT@before_invoke, /) -> Coroutine[Any, Any, Any]) | ((ContextT@before_invoke, /) -> Coroutine[Any, Any, Any])` is not assignable to attribute `__before_invoke__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, (...), Unknown]]`
- discord/ext/commands/core.py:2657:13 error[invalid-assignment] Object of type `((CogT@after_invoke, ContextT@after_invoke, /) -> Coroutine[Any, Any, Any]) | ((ContextT@after_invoke, /) -> Coroutine[Any, Any, Any])` is not assignable to attribute `__after_invoke__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, Top[(...)], Unknown]]`
+ discord/ext/commands/core.py:2657:13 error[invalid-assignment] Object of type `((CogT@after_invoke, ContextT@after_invoke, /) -> Coroutine[Any, Any, Any]) | ((ContextT@after_invoke, /) -> Coroutine[Any, Any, Any])` is not assignable to attribute `__after_invoke__` on type `((...) -> Coroutine[Any, Any, Any]) & ~Top[Command[Unknown, (...), Unknown]]`
- discord/ext/commands/hybrid.py:940:92 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ discord/ext/commands/hybrid.py:348:9 error[invalid-method-override] Invalid override of method `_copy_with`: Definition is incompatible with `Command._copy_with`
+ discord/ext/commands/hybrid.py:376:65 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Command[Any, (...), Any] | ContextMenu | Group`, found `Self@_transform_arguments`
+ discord/ext/commands/hybrid.py:387:65 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Command[Any, (...), Any] | ContextMenu | Group`, found `Self@_transform_arguments`
+ discord/ext/commands/hybrid.py:534:13 error[invalid-assignment] Object of type `HybridAppCommand[CogT@HybridAppCommand, P@HybridAppCommand, T@HybridAppCommand] | None` is not assignable to `HybridAppCommand[CogT@HybridCommand, (...), T@HybridCommand] | None`: Incompatible value of type `HybridAppCommand[CogT@HybridAppCommand, P@HybridAppCommand, T@HybridAppCommand] | None`
+ discord/ext/commands/hybrid.py:534:30 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `HybridCommand[CogT@HybridCommand, (...), T@HybridCommand] | HybridGroup[CogT@HybridCommand, (...), T@HybridCommand]`, found `Self@__init__`
+ discord/ext/commands/hybrid.py:700:44 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `HybridCommand[Unknown, (...), Unknown] | HybridGroup[Unknown, (...), Unknown]`, found `Self@__init__`
+ discord/ext/commands/hybrid.py:701:46 error[invalid-argument-type] Argument to bound method `add_command` is incorrect: Expected `Command[Any, (...), Any] | Group`, found `HybridAppCommand[CogT@HybridAppCommand, P@HybridAppCommand, T@HybridAppCommand]`

starlette (https://github.com/encode/starlette)
+ tests/middleware/test_base.py:247:33 error[missing-argument] No argument provided for required parameter 1 of bound method `__init__`

strawberry (https://github.com/strawberry-graphql/strawberry)
- strawberry/types/fields/resolver.py:417:20 error[invalid-return-type] Return type does not match returned value: expected `(...) -> T@StrawberryResolver`, found `Top[(...) -> object]`
+ strawberry/types/fields/resolver.py:417:20 error[invalid-return-type] Return type does not match returned value: expected `(...) -> T@StrawberryResolver`, found `((type, /, *args: object, **kwargs: object) -> object) | ((...) -> Unknown)`

streamlit (https://github.com/streamlit/streamlit)
+ lib/streamlit/runtime/caching/cache_utils.py:266:57 error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `CachedFunc[_PWrapper@update_wrapper, Unknown]`, found `Self@__get__`

Full report with detailed diff (timing results)

@charliermarsh charliermarsh marked this pull request as ready for review April 8, 2026 01:57
@charliermarsh charliermarsh marked this pull request as draft April 8, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants