Skip to content

[ty] Preserve argument signature in @total_ordering#22496

Merged
charliermarsh merged 2 commits intomainfrom
charlie/total-ord
Jan 10, 2026
Merged

[ty] Preserve argument signature in @total_ordering#22496
charliermarsh merged 2 commits intomainfrom
charlie/total-ord

Conversation

@charliermarsh
Copy link
Member

Summary

Closes astral-sh/ty#2435.

@charliermarsh charliermarsh added bug Something isn't working ty Multi-file analysis & type inference labels Jan 10, 2026
@charliermarsh charliermarsh marked this pull request as ready for review January 10, 2026 16:13
@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 10, 2026

Diagnostic diff on typing conformance tests

No changes detected when running ty on typing conformance tests ✅

@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 10, 2026

mypy_primer results

Changes were detected when running on open source projects
mkosi (https://github.com/systemd/mkosi)
- mkosi/__init__.py:1769:13: error[unsupported-operator] Operator `>=` is not supported between objects of type `GenericVersion` and `Literal["258"]`
- mkosi/__init__.py:1829:13: error[unsupported-operator] Operator `>=` is not supported between objects of type `GenericVersion` and `Literal["256"]`
- mkosi/__init__.py:1836:17: error[unsupported-operator] Operator `>=` is not supported between objects of type `GenericVersion & ~AlwaysFalsy` and `Literal["256"]`
- mkosi/__init__.py:3451:17: error[unsupported-operator] Operator `>=` is not supported between objects of type `GenericVersion` and `Literal[256]`
- mkosi/__init__.py:3456:17: error[unsupported-operator] Operator `>=` is not supported between objects of type `GenericVersion` and `Literal[258]`
- mkosi/bootloader.py:738:83: error[unsupported-operator] Operator `>=` is not supported between objects of type `GenericVersion` and `Literal["257"]`
- mkosi/config.py:1565:8: error[unsupported-operator] Operator `>` is not supported between objects of type `GenericVersion` and `Literal["27~devel"]`
- mkosi/config.py:1571:21: error[unsupported-operator] Operator `>` is not supported between objects of type `GenericVersion` and `str & ~AlwaysFalsy`
- mkosi/distribution/centos.py:61:13: error[unsupported-operator] Operator `>` is not supported between objects of type `GenericVersion` and `Literal[9]`
- mkosi/distribution/centos.py:70:12: error[unsupported-operator] Operator `<=` is not supported between objects of type `GenericVersion` and `Literal[8]`
- mkosi/distribution/centos.py:255:12: error[unsupported-operator] Operator `>=` is not supported between objects of type `GenericVersion` and `Literal[10]`
- mkosi/distribution/opensuse.py:71:60: error[unsupported-operator] Operator `>=` is not supported between objects of type `GenericVersion` and `Literal[16]`
- mkosi/distribution/opensuse.py:219:20: error[unsupported-operator] Operator `>=` is not supported between objects of type `GenericVersion` and `Literal[16]`
- mkosi/qemu.py:276:24: error[unsupported-operator] Operator `>=` is not supported between objects of type `GenericVersion` and `Literal["0.10.0"]`
- mkosi/tree.py:149:69: error[unsupported-operator] Operator `>=` is not supported between objects of type `GenericVersion` and `Literal["9.5"]`
- Found 92 diagnostics
+ Found 77 diagnostics

tornado (https://github.com/tornadoweb/tornado)
- tornado/gen.py:255:62: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `None | Awaitable[Unknown] | list[Awaitable[Unknown]] | dict[Any, Awaitable[Unknown]] | Future[Unknown]`, found `_T@next | _VT@next | _T@next`
+ tornado/gen.py:255:62: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `None | Awaitable[Unknown] | list[Awaitable[Unknown]] | dict[Any, Awaitable[Unknown]] | Future[Unknown]`, found `_T@next | _T@next | _VT@next`

prefect (https://github.com/PrefectHQ/prefect)
- src/integrations/prefect-dbt/prefect_dbt/core/settings.py:94:28: error[invalid-assignment] Object of type `T@resolve_block_document_references | dict[str, Any] | str | ... omitted 4 union elements` is not assignable to `dict[str, Any]`
+ src/integrations/prefect-dbt/prefect_dbt/core/settings.py:94:28: error[invalid-assignment] Object of type `T@resolve_block_document_references | dict[str, Any]` is not assignable to `dict[str, Any]`
- src/integrations/prefect-dbt/prefect_dbt/core/settings.py:99:28: error[invalid-assignment] Object of type `T@resolve_variables | str | int | ... omitted 4 union elements` is not assignable to `dict[str, Any]`
+ src/integrations/prefect-dbt/prefect_dbt/core/settings.py:99:28: error[invalid-assignment] Object of type `T@resolve_variables | dict[str, Any]` is not assignable to `dict[str, Any]`
- src/prefect/cli/deploy/_core.py:86:21: error[invalid-assignment] Object of type `T@resolve_block_document_references | dict[str, Any] | str | ... omitted 4 union elements` is not assignable to `dict[str, Any]`
+ src/prefect/cli/deploy/_core.py:86:21: error[invalid-assignment] Object of type `T@resolve_block_document_references | dict[str, Any]` is not assignable to `dict[str, Any]`
- src/prefect/cli/deploy/_core.py:87:21: error[invalid-assignment] Object of type `T@resolve_variables | str | int | ... omitted 4 union elements` is not assignable to `dict[str, Any]`
+ src/prefect/cli/deploy/_core.py:87:21: error[invalid-assignment] Object of type `T@resolve_variables` is not assignable to `dict[str, Any]`
- src/prefect/deployments/steps/core.py:137:38: error[invalid-argument-type] Argument is incorrect: Expected `T@resolve_variables`, found `T@resolve_block_document_references | dict[str, Any] | str | ... omitted 4 union elements`
+ src/prefect/deployments/steps/core.py:137:38: error[invalid-argument-type] Argument is incorrect: Expected `T@resolve_variables`, found `T@resolve_block_document_references | dict[str, Any]`
- src/prefect/utilities/templating.py:320:13: error[invalid-assignment] Invalid subscript assignment with key of type `object` and value of type `T@resolve_block_document_references | dict[str, Any] | str | ... omitted 4 union elements` on object of type `dict[str, Any]`
+ src/prefect/utilities/templating.py:320:13: error[invalid-assignment] Invalid subscript assignment with key of type `object` and value of type `T@resolve_block_document_references | dict[str, Any]` on object of type `dict[str, Any]`
- src/prefect/utilities/templating.py:323:16: error[invalid-return-type] Return type does not match returned value: expected `T@resolve_block_document_references | dict[str, Any]`, found `list[T@resolve_block_document_references | dict[str, Any] | str | ... omitted 5 union elements]`
+ src/prefect/utilities/templating.py:323:16: error[invalid-return-type] Return type does not match returned value: expected `T@resolve_block_document_references | dict[str, Any]`, found `list[T@resolve_block_document_references | dict[str, Any] | Unknown]`
- src/prefect/utilities/templating.py:437:16: error[invalid-return-type] Return type does not match returned value: expected `T@resolve_variables`, found `dict[object, T@resolve_variables | str | int | ... omitted 5 union elements]`
+ src/prefect/utilities/templating.py:437:16: error[invalid-return-type] Return type does not match returned value: expected `T@resolve_variables`, found `dict[object, T@resolve_variables | Unknown]`
- src/prefect/utilities/templating.py:442:16: error[invalid-return-type] Return type does not match returned value: expected `T@resolve_variables`, found `list[T@resolve_variables | str | int | ... omitted 5 union elements]`
+ src/prefect/utilities/templating.py:442:16: error[invalid-return-type] Return type does not match returned value: expected `T@resolve_variables`, found `list[T@resolve_variables | Unknown]`
- src/prefect/workers/base.py:232:13: error[invalid-argument-type] Argument is incorrect: Expected `T@resolve_variables`, found `T@resolve_block_document_references | dict[str, Any] | str | ... omitted 4 union elements`
+ src/prefect/workers/base.py:232:13: error[invalid-argument-type] Argument is incorrect: Expected `T@resolve_variables`, found `T@resolve_block_document_references | dict[str, Any]`
- src/prefect/workers/base.py:234:20: error[invalid-argument-type] Argument expression after ** must be a mapping type: Found `T@resolve_variables | str | int | ... omitted 4 union elements`
+ src/prefect/workers/base.py:234:20: error[invalid-argument-type] Argument expression after ** must be a mapping type: Found `T@resolve_variables`

pwndbg (https://github.com/pwndbg/pwndbg)
- pwndbg/aglib/nearpc.py:304:12: error[unsupported-operator] Operator `>` is not supported between objects of type `Parameter` and `Literal[0]`
- pwndbg/aglib/nearpc.py:310:16: error[unsupported-operator] Operator `>` is not supported between objects of type `Parameter` and `Literal[0]`
- pwndbg/commands/context.py:388:8: error[unsupported-operator] Operator `<=` is not supported between objects of type `Parameter` and `Literal[0]`
- pwndbg/commands/context.py:403:12: error[unsupported-operator] Operator `<=` is not supported between objects of type `Parameter` and `Literal[0]`
- pwndbg/commands/context.py:739:43: error[unsupported-operator] Operator `<=` is not supported between objects of type `Parameter` and `Literal[0]`
- pwndbg/commands/telescope.py:217:32: error[unsupported-operator] Operator `>=` is not supported between objects of type `int` and `Parameter`
- pwndbg/lib/pretty_print.py:327:12: error[unsupported-operator] Operator `>` is not supported between objects of type `Parameter` and `Literal[0]`
- Found 2062 diagnostics
+ Found 2055 diagnostics

scikit-build-core (https://github.com/scikit-build/scikit-build-core)
+ src/scikit_build_core/build/wheel.py:99:20: error[no-matching-overload] No overload of bound method `__init__` matches arguments
- Found 47 diagnostics
+ Found 48 diagnostics

static-frame (https://github.com/static-frame/static-frame)
- static_frame/core/bus.py:671:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemLocReduces[Bus[Any], object_]`, found `InterGetItemLocReduces[Bus[Any] | Bottom[Index[Any]] | Bottom[Series[Any, Any]] | ... omitted 6 union elements, object_]`
+ static_frame/core/bus.py:671:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemLocReduces[Bus[Any], object_]`, found `InterGetItemLocReduces[Bus[Any] | Bottom[Series[Any, Any]] | ndarray[Never, Never] | ... omitted 6 union elements, object_]`
- static_frame/core/index.py:580:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemLocReduces[TVContainer_co@loc, TVDtype@Index]`, found `InterGetItemLocReduces[Any | Bottom[Series[Any, Any]], TVDtype@Index]`
+ static_frame/core/index.py:580:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemLocReduces[TVContainer_co@loc, TVDtype@Index]`, found `InterGetItemLocReduces[Bottom[Series[Any, Any]] | Any, TVDtype@Index]`
- static_frame/core/yarn.py:418:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemILocReduces[Yarn[Any], object_]`, found `InterGetItemILocReduces[Yarn[Any] | ndarray[Never, Never] | TypeBlocks | ... omitted 6 union elements, object_]`
+ static_frame/core/yarn.py:418:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemILocReduces[Yarn[Any], object_]`, found `InterGetItemILocReduces[Yarn[Any] | Bottom[Index[Any]] | TypeBlocks | ... omitted 6 union elements, object_]`

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- pandas-stubs/_typing.pyi:1232:16: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- Found 5170 diagnostics
+ Found 5169 diagnostics

core (https://github.com/home-assistant/core)
- homeassistant/util/variance.py:47:12: error[invalid-return-type] Return type does not match returned value: expected `(**_P@ignore_variance) -> _R@ignore_variance`, found `_Wrapped[_P@ignore_variance, _R@ignore_variance | int | float | datetime, _P@ignore_variance, _R@ignore_variance | int | float | datetime]`
- Found 14503 diagnostics
+ Found 14502 diagnostics

No memory usage changes detected ✅

@charliermarsh charliermarsh merged commit 2c68057 into main Jan 10, 2026
48 checks passed
@charliermarsh charliermarsh deleted the charlie/total-ord branch January 10, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

total_ordering generated methods should derive their signature from the user-provided comparison method

3 participants