Skip to content

[ty] Render all changed diagnostics in conformance.py#23613

Merged
AlexWaygood merged 20 commits intoastral-sh:mainfrom
WillDuke:wld/render-all-conformance-changes
Mar 5, 2026
Merged

[ty] Render all changed diagnostics in conformance.py#23613
AlexWaygood merged 20 commits intoastral-sh:mainfrom
WillDuke:wld/render-all-conformance-changes

Conversation

@WillDuke
Copy link
Contributor

@WillDuke WillDuke commented Feb 27, 2026

Summary

This is meant to fix astral-sh/ty#2786. Previously, the conformance.py script would only render changed diagnostics if one of the ty versions raised no diagnostics in the test group. This PR updates the change detection logic and the renderer so that we display both the old and new diagnostics if they are not identical. I've also created separate sections for cases where diagnostics changed without changing the classification as well as a new Files changed section that shows how performance at the file level has changed.

Test Plan

I'll try cherry-picking #23088 and take a look at the comment.

I also ran the following command to see how the output would look against 0.0.18:

uv run --no-project --python 3.12 scripts/conformance.py --tests-path ./../typing/conformance/ --old-ty uvx ty@0.0.18

Which returned the following:

conformance.md

Typing conformance results improved 🎉

Summary

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 761 763 +2 ⏫ (✅)
False Positives 141 141 +0
False Negatives 270 269 -1 ⏬ (✅)
Total Diagnostics 971 973 +2
Precision 84.37% 84.40% +0.03% ⏫ (✅)
Recall 73.81% 73.93% +0.12% ⏫ (✅)

Files changed

File True Positives False Positives False Negatives Status
enums_member_values.py 6 (+2) ✅ 0 0 (-1) ✅ ✅ Newly Passing 🎉
aliases_typealiastype.py 15 0 (-1) ✅ 7
narrowing_typeis.py 9 1 (+1) ❌ 0 ❌ Regressed
Total 763 (+2) ✅ 141 269 (-1) ✅ 48/131

True positives added (1)

1 diagnostic
Test caseΔLocationNameMessage
enums_member_values.py:78+78:5invalid-assignmentEnum member `GREEN` value is not assignable to expected type

False positives removed (1)

1 diagnostic
Test caseΔLocationNameMessage
aliases_typealiastype.py:23-23:5invalid-argument-typeArgument to class `TypeAliasType` is incorrect: Expected `tuple[TypeVar | ParamSpec | typing_extensions.TypeVarTuple, ...]`, found `tuple[TypeVar, TypeVar, ParamSpec, typing.TypeVarTuple]`

True positives changed (6)

6 diagnostics
Test caseΔLocationNameMessage
aliases_explicit.py:102-102:5not-subscriptableCannot subscript non-generic type
+102:5not-subscriptableCannot subscript non-generic type `<types.UnionType special-form 'list[Unknown] | set[Unknown]'>`
aliases_explicit.py:67-67:9not-subscriptableCannot subscript non-generic type
+67:9not-subscriptableCannot subscript non-generic type `<types.UnionType special-form 'int | None'>`
aliases_explicit.py:68-68:9not-subscriptableCannot subscript non-generic type: `<class 'list[int | None]'>` is already specialized
+68:9not-subscriptableCannot subscript non-generic type `<class 'list[int | None]'>`
aliases_implicit.py:135-135:5not-subscriptableCannot subscript non-generic type
+135:5not-subscriptableCannot subscript non-generic type `<types.UnionType special-form 'list[Unknown] | set[Unknown]'>`
aliases_implicit.py:76-76:9not-subscriptableCannot subscript non-generic type
+76:9not-subscriptableCannot subscript non-generic type `<types.UnionType special-form 'int | None'>`
aliases_implicit.py:77-77:9not-subscriptableCannot subscript non-generic type: `<class 'list[int | None]'>` is already specialized
+77:9not-subscriptableCannot subscript non-generic type `<class 'list[int | None]'>`

False positives changed (1)

1 diagnostic
Test caseΔLocationNameMessage
generics_typevartuple_specialization.py:45-45:40not-subscriptableCannot subscript non-generic type: `<class 'tuple[str, @todo]'>` is already specialized
+45:40not-subscriptableCannot subscript non-generic type `<class 'tuple[str, @todo]'>`

False positives added (1)

1 diagnostic
Test caseΔLocationNameMessage
narrowing_typeis.py:35+35:18invalid-assignmentObject of type `object` is not assignable to `int`

Optional Diagnostics Added (2)

2 diagnostics
Test caseΔLocationNameMessage
enums_member_values.py:50+50:5invalid-assignmentEnum member `MARS` is incompatible with `__init__`
enums_member_values.py:51+51:5invalid-assignmentEnum member `JUPITER` is incompatible with `__init__`

Optional Diagnostics Removed (1)

1 diagnostic
Test caseΔLocationNameMessage
enums_member_values.py:96-96:1type-assertion-failureType `Unknown` does not match asserted type `int`

Optional Diagnostics Changed (1)

1 diagnostic
Test caseΔLocationNameMessage
enums_member_values.py:54-54:1type-assertion-failureType `tuple[Literal[1], float, float]` does not match asserted type `Literal[1]`
+54:1type-assertion-failureType `Any` does not match asserted type `Literal[1]`

@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 27, 2026

Typing conformance results

No changes detected ✅


The percentage of diagnostics emitted that were expected errors held steady at 86.56%. The percentage of expected errors that received a diagnostic held steady at 77.40%.

@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 27, 2026

Memory usage report

Summary

Project Old New Diff Outcome
prefect 693.21MB 693.22MB +0.00% (11.88kB)
sphinx 267.75MB 267.75MB +0.00% (2.99kB)
trio 118.59MB 118.59MB +0.00% (912.00B)
flake8 48.17MB 48.17MB +0.00% (448.00B)

Significant changes

Click to expand detailed breakdown

prefect

Name Old New Diff Outcome
StaticClassLiteral<'db>::fields_ 94.65kB 104.36kB +10.25% (9.70kB)
infer_scope_types_impl 51.57MB 51.57MB +0.00% (2.11kB)
FieldInstance 384.00B 448.00B +16.67% (64.00B)

sphinx

Name Old New Diff Outcome
StaticClassLiteral<'db>::fields_ 18.64kB 20.75kB +11.31% (2.11kB)
infer_scope_types_impl 15.63MB 15.63MB +0.01% (888.00B)
FieldInstance 96.00B 112.00B +16.67% (16.00B)

trio

Name Old New Diff Outcome
infer_scope_types_impl 4.80MB 4.80MB +0.02% (912.00B)

flake8

Name Old New Diff Outcome
StaticClassLiteral<'db>::fields_ 4.11kB 4.54kB +10.66% (448.00B)

@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 27, 2026

mypy_primer results

Changes were detected when running on open source projects
attrs (https://github.com/python-attrs/attrs)
- tests/dataclass_transform_example.py:21:13: info[revealed-type] Revealed type: `(self: DefineConverter, with_converter: int) -> None`
+ tests/dataclass_transform_example.py:21:13: info[revealed-type] Revealed type: `(self: DefineConverter, with_converter: str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc) -> None`
- tests/dataclass_transform_example.py:23:17: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal[b"42"]`
- tests/test_hooks.py:70:15: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["3"]`
- tests/test_next_gen.py:388:9: error[invalid-assignment] Object of type `Literal["11"]` is not assignable to attribute `x` of type `int`
- tests/test_next_gen.py:394:13: error[invalid-assignment] Object of type `Literal["9"]` is not assignable to attribute `x` of type `int`
- typing-examples/mypy.py:181:13: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["on"]`
- typing-examples/mypy.py:182:13: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["yes"]`
- typing-examples/mypy.py:185:13: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["n"]`
- Found 640 diagnostics
+ Found 633 diagnostics

pip (https://github.com/pypa/pip)
- src/pip/_internal/req/req_uninstall.py:132:42: error[invalid-argument-type] Argument to function `norm_join` is incorrect: Expected `str`, found `Unknown | Sized`
+ src/pip/_internal/req/req_uninstall.py:132:42: error[invalid-argument-type] Argument to function `norm_join` is incorrect: Expected `str`, found `Sized | Unknown`
- src/pip/_internal/req/req_uninstall.py:133:40: error[invalid-argument-type] Argument to function `norm_join` is incorrect: Expected `str`, found `Unknown | Sized`
+ src/pip/_internal/req/req_uninstall.py:133:40: error[invalid-argument-type] Argument to function `norm_join` is incorrect: Expected `str`, found `Sized | Unknown`
- src/pip/_internal/req/req_uninstall.py:139:27: error[unsupported-operator] Operator `+` is not supported between objects of type `Unknown | Sized` and `LiteralString`
+ src/pip/_internal/req/req_uninstall.py:139:27: error[unsupported-operator] Operator `+` is not supported between objects of type `Sized | Unknown` and `LiteralString`

aiortc (https://github.com/aiortc/aiortc)
- src/aiortc/sdp.py:446:52: error[invalid-argument-type] Argument is incorrect: Expected `str`, found `None | str | Unknown`
+ src/aiortc/sdp.py:446:52: error[invalid-argument-type] Argument is incorrect: Expected `str`, found `None | Unknown | str`

rich (https://github.com/Textualize/rich)
- tests/test_tools.py:17:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, str | Unknown]]`
+ tests/test_tools.py:17:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, Unknown | str]]`
- tests/test_tools.py:18:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, str | Unknown]]`
+ tests/test_tools.py:18:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, Unknown | str]]`
- tests/test_tools.py:19:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, str | Unknown]]`
+ tests/test_tools.py:19:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, Unknown | str]]`
- tests/test_tools.py:20:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, str | Unknown]]`
+ tests/test_tools.py:20:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, Unknown | str]]`

pylox (https://github.com/sco1/pylox)
- pylox/containers/array.py:146:9: error[invalid-assignment] Object of type `deque[Unknown | None]` is not assignable to attribute `fields` of type `dict[Unknown, Unknown]`
+ pylox/containers/array.py:146:9: error[invalid-assignment] Object of type `deque[None | Unknown]` is not assignable to attribute `fields` of type `dict[Unknown, Unknown]`

porcupine (https://github.com/Akuli/porcupine)
- porcupine/pluginmanager.py:133:49: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Iterable[Never]`, found `Unknown | str`
- Found 25 diagnostics
+ Found 24 diagnostics

artigraph (https://github.com/artigraph/artigraph)
- tests/arti/types/test_types.py:100:51: error[invalid-argument-type] Argument is incorrect: Expected `frozenset[Any]`, found `frozenset[float | Unknown | int] | list[Unknown | int | float] | tuple[float | Unknown | int, ...]`
+ tests/arti/types/test_types.py:100:51: error[invalid-argument-type] Argument is incorrect: Expected `frozenset[Any]`, found `frozenset[float | Unknown | int] | list[int | Unknown | float] | tuple[float | Unknown | int, ...]`

trio (https://github.com/python-trio/trio)
- src/trio/_tests/test_highlevel_open_tcp_listeners.py:235:35: error[invalid-argument-type] Argument is incorrect: Expected `SocketKind`, found `int`
- Found 471 diagnostics
+ Found 470 diagnostics

meson (https://github.com/mesonbuild/meson)
- mesonbuild/dependencies/cuda.py:137:76: error[invalid-argument-type] Argument to function `version_compare_many` is incorrect: Expected `str`, found `str | None | Unknown`
+ mesonbuild/dependencies/cuda.py:137:76: error[invalid-argument-type] Argument to function `version_compare_many` is incorrect: Expected `str`, found `Unknown | str | None`

cloud-init (https://github.com/canonical/cloud-init)
- tests/unittests/distros/test_user_data_normalize.py:24:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[Unknown, Unknown]`, found `Unknown | dict[Unknown | str, Unknown | str] | str | ... omitted 3 union elements`
+ tests/unittests/distros/test_user_data_normalize.py:24:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[Unknown, Unknown]`, found `Unknown | bool | list[Unknown] | ... omitted 3 union elements`
- tests/unittests/sources/test_gce.py:71:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[Unknown, Unknown]`, found `Unknown | dict[Unknown | str, Unknown | str] | str | ... omitted 3 union elements`
+ tests/unittests/sources/test_gce.py:71:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[Unknown, Unknown]`, found `Unknown | bool | list[Unknown] | ... omitted 3 union elements`

dd-trace-py (https://github.com/DataDog/dd-trace-py)
- scripts/freshvenvs.py:343:69: error[invalid-argument-type] Argument to function `_versions_fully_cover_bounds` is incorrect: Expected `list[str]`, found `list[Version | Unknown] & ~AlwaysFalsy`
+ scripts/freshvenvs.py:343:69: error[invalid-argument-type] Argument to function `_versions_fully_cover_bounds` is incorrect: Expected `list[str]`, found `list[Unknown | Version] & ~AlwaysFalsy`
- setup.py:1280:5: error[invalid-argument-type] Argument to function `setup` is incorrect: Expected `_MutableDictLike[str, type[Command]]`, found `dict[str, <class 'CustomBuildExt'> | <class 'LibraryDownloader'> | <class 'CustomBuildRust'> | <class 'CleanLibraries'> | <class 'ExtensionHashes'>]`
+ setup.py:1280:5: error[invalid-argument-type] Argument to function `setup` is incorrect: Expected `_MutableDictLike[str, type[Command]]`, found `dict[Unknown | str, Unknown | <class 'CustomBuildExt'> | <class 'LibraryDownloader'> | ... omitted 3 union elements]`

prefect (https://github.com/PrefectHQ/prefect)
+ src/prefect/utilities/asyncutils.py:198:16: error[invalid-return-type] Return type does not match returned value: expected `R@run_coro_as_sync | None`, found `CoroutineType[Any, Any, R@run_coro_as_sync | None] | R@run_coro_as_sync | None`
+ src/prefect/utilities/asyncutils.py:207:20: error[invalid-return-type] Return type does not match returned value: expected `R@run_coro_as_sync | None`, found `CoroutineType[Any, Any, R@run_coro_as_sync | None] | R@run_coro_as_sync | None`
- Found 5796 diagnostics
+ Found 5798 diagnostics

pandas (https://github.com/pandas-dev/pandas)
- pandas/core/methods/describe.py:210:21: error[not-iterable] Object of type `Unknown | Sized` may not be iterable
+ pandas/core/methods/describe.py:210:21: error[not-iterable] Object of type `Sized | Unknown` may not be iterable

sympy (https://github.com/sympy/sympy)
+ sympy/algebras/tests/test_quaternion.py:423:33: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/codegen/tests/test_matrix_nodes.py:28:21: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/expressions/tests/test_blockmatrix.py:236:13: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/expressions/tests/test_blockmatrix.py:236:33: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/expressions/tests/test_blockmatrix.py:236:53: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/expressions/tests/test_blockmatrix.py:460:12: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/expressions/tests/test_derivatives.py:552:26: error[unsupported-operator] Operator `+` is not supported between two objects of type `MatrixBase | Expr`
+ sympy/matrices/expressions/tests/test_matadd.py:37:12: error[unsupported-operator] Operator `+` is not supported between objects of type `MatrixBase` and `MatrixBase | Expr`
+ sympy/matrices/expressions/tests/test_matpow.py:125:47: error[unsupported-operator] Operator `+` is not supported between two objects of type `ImmutableDenseMatrix`
+ 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:393:11: error[unsupported-operator] Operator `+` is not supported between objects of type `MatrixBase` and `MatrixBase | Expr | Unknown`
+ sympy/matrices/matrixbase.py:979:18: error[unsupported-operator] Operator `+` is not supported between two objects of type `Self@_eval_wilkinson`
+ sympy/matrices/matrixbase.py:3256:16: error[invalid-return-type] Return type does not match returned value: expected `MatrixBase`, found `T2'return@call_highest_priority | T1'return@call_highest_priority`
+ sympy/matrices/matrixbase.py:3256:29: error[invalid-argument-type] Argument is incorrect: Expected `T2'return@call_highest_priority | T1'return@call_highest_priority`, found `MatrixBase`
+ sympy/matrices/matrixbase.py:3310:16: error[unsupported-operator] Operator `+` is not supported between two objects of type `MatrixBase`
+ sympy/matrices/matrixbase.py:3314:16: error[invalid-return-type] Return type does not match returned value: expected `Tmat@__sub__`, found `MatrixBase`
+ sympy/matrices/matrixbase.py:4386:16: error[unsupported-operator] Operator `+` is not supported between two objects of type `Self@add`
+ sympy/matrices/repmatrix.py:321:17: error[unsupported-operator] Operator `-` is not supported between two objects of type `Self@_eval_is_symmetric`
+ sympy/matrices/tests/test_commonmatrix.py:1250:31: error[unsupported-operator] Operator `+` is not supported between objects of type `MutableDenseMatrix` and `ImmutableDenseNDimArray`
+ sympy/matrices/tests/test_eigen.py:407:20: error[invalid-argument-type] Argument to function `max` is incorrect: Expected `Iterable[Unknown]`, found `MatrixBase | Unknown`
+ sympy/matrices/tests/test_immutable.py:106:23: error[unsupported-operator] Operator `+` is not supported between two objects of type `ImmutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:122:12: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:124:32: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:142:12: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:2180:22: error[unsupported-operator] Operator `+` is not supported between two objects of type `Unknown | MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:2208:26: error[unsupported-operator] Operator `+` is not supported between two objects of type `Unknown | MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:2909:21: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:2922:13: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:2937:13: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:2938:13: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:2949:14: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:3472:21: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:3479:12: error[unresolved-attribute] Attribute `rank` is not defined on `MatrixExpr` in union `MatrixBase | MatrixExpr | Unknown`
+ sympy/matrices/tests/test_matrices.py:3480:12: error[unresolved-attribute] Attribute `rank` is not defined on `MatrixExpr` in union `MatrixBase | MatrixExpr | Unknown`
+ sympy/matrices/tests/test_matrixbase.py:492:12: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:494:32: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:545:12: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:824:31: error[unsupported-operator] Operator `+` is not supported between objects of type `MutableDenseMatrix` and `ImmutableDenseNDimArray`
+ sympy/matrices/tests/test_matrixbase.py:877:12: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:879:32: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:901:12: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:2932:22: error[unsupported-operator] Operator `+` is not supported between two objects of type `Unknown | MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:2960:26: error[unsupported-operator] Operator `+` is not supported between two objects of type `Unknown | MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:3611:21: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:3625:13: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:3640:13: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:3641:13: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:3653:14: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_reductions.py:378:21: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_reductions.py:385:12: error[unresolved-attribute] Attribute `rank` is not defined on `MatrixExpr` in union `MatrixBase | MatrixExpr | Unknown`
+ sympy/matrices/tests/test_reductions.py:386:12: error[unresolved-attribute] Attribute `rank` is not defined on `MatrixExpr` in union `MatrixBase | MatrixExpr | Unknown`
+ sympy/matrices/tests/test_solvers.py:69:13: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_sparse.py:574:12: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableSparseMatrix`
+ sympy/matrices/tests/test_sparse.py:578:52: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableSparseMatrix`
+ sympy/matrices/tests/test_sparse.py:594:17: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableSparseMatrix`
+ sympy/parsing/autolev/test-examples/ruletest5.py:13:6: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/parsing/autolev/test-examples/ruletest5.py:16:38: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/parsing/autolev/test-examples/ruletest5.py:16:84: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/parsing/autolev/test-examples/ruletest5.py:16:131: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/parsing/autolev/test-examples/ruletest5.py:21:44: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/parsing/autolev/test-examples/ruletest5.py:21:90: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/parsing/autolev/test-examples/ruletest5.py:21:137: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/parsing/autolev/test-examples/ruletest5.py:25:37: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/parsing/autolev/test-examples/ruletest5.py:25:83: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/parsing/autolev/test-examples/ruletest5.py:25:130: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/parsing/mathematica.py:692:38: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Iterable[Never]`, found `Unknown | list[Unknown | str]`
+ sympy/physics/control/tests/test_lti.py:3778:31: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/physics/control/tests/test_lti.py:3778:38: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/physics/mechanics/lagrange.py:223:23: error[unsupported-operator] Operator `-` is not supported between two objects of type `Unknown | MutableDenseMatrix`
+ sympy/physics/mechanics/lagrange.py:347:17: error[unsupported-operator] Operator `+` is not supported between two objects of type `Unknown | MutableDenseMatrix`
+ sympy/physics/mechanics/linearize.py:218:28: error[unsupported-operator] Operator `+` is not supported between two objects of type `Unknown | MutableDenseMatrix`
+ sympy/physics/mechanics/linearize.py:230:29: error[unsupported-operator] Operator `+` is not supported between two objects of type `Unknown | MutableDenseMatrix`
+ sympy/physics/mechanics/linearize.py:242:29: error[unsupported-operator] Operator `+` is not supported between two objects of type `Unknown | MutableDenseMatrix`
+ sympy/physics/mechanics/tests/test_jointsmethod.py:248:17: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/physics/mechanics/tests/test_jointsmethod.py:250:17: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/physics/quantum/tests/test_represent.py:90:17: error[unsupported-operator] Operator `+` is not supported between objects of type `MatrixBase | Expr` and `MatrixBase`
+ sympy/physics/quantum/tests/test_represent.py:92:24: error[unsupported-operator] Operator `-` is not supported between two objects of type `MatrixBase | Expr`
+ sympy/physics/quantum/tests/test_represent.py:94:28: error[unsupported-operator] Operator `+` is not supported between two objects of type `MatrixBase | Expr`
+ sympy/physics/vector/functions.py:381:21: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `MatrixBase | Unknown`
+ sympy/solvers/tests/test_numeric.py:138:11: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
- sympy/solvers/tests/test_pde.py:109:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(str | Unknown, /) -> Unknown`, found `<class 'Function'>`
+ sympy/solvers/tests/test_pde.py:109:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(Unknown | str, /) -> Unknown`, found `<class 'Function'>`
- sympy/solvers/tests/test_pde.py:130:22: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(str | Unknown, /) -> Unknown`, found `<class 'Function'>`
+ sympy/solvers/tests/test_pde.py:130:22: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(Unknown | str, /) -> Unknown`, found `<class 'Function'>`
- sympy/solvers/tests/test_pde.py:138:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(str | Unknown, /) -> Unknown`, found `<class 'Function'>`
+ sympy/solvers/tests/test_pde.py:138:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(Unknown | str, /) -> Unknown`, found `<class 'Function'>`
- sympy/solvers/tests/test_pde.py:164:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(str | Unknown, /) -> Unknown`, found `<class 'Function'>`
+ sympy/solvers/tests/test_pde.py:164:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(Unknown | str, /) -> Unknown`, found `<class 'Function'>`
- sympy/solvers/tests/test_pde.py:202:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(str | Unknown, /) -> Unknown`, found `<class 'Function'>`
+ sympy/solvers/tests/test_pde.py:202:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(Unknown | str, /) -> Unknown`, found `<class 'Function'>`
- sympy/solvers/tests/test_pde.py:216:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(str | Unknown, /) -> Unknown`, found `<class 'Function'>`
+ sympy/solvers/tests/test_pde.py:216:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(Unknown | str, /) -> Unknown`, found `<class 'Function'>`
+ sympy/solvers/tests/test_solvers.py:723:19: error[unsupported-operator] Operator `-` is not supported between two objects of type `MatrixBase | Expr`
+ sympy/solvers/tests/test_solvers.py:724:19: error[unsupported-operator] Operator `-` is not supported between two objects of type `MatrixBase | Expr`
+ sympy/solvers/tests/test_solvers.py:725:19: error[unsupported-operator] Operator `-` is not supported between two objects of type `MatrixBase | Expr`
+ sympy/solvers/tests/test_solvers.py:725:30: error[unsupported-operator] Operator `-` is not supported between two objects of type `MatrixBase | Expr`
- sympy/stats/symbolic_probability.py:532:55: error[unresolved-attribute] Attribute `expand` is not defined on `Basic` in union `Unknown | Basic`
+ sympy/stats/symbolic_probability.py:532:55: error[unresolved-attribute] Attribute `expand` is not defined on `Basic` in union `Basic | Unknown`
- sympy/stats/symbolic_probability.py:533:55: error[unresolved-attribute] Attribute `expand` is not defined on `Basic` in union `Unknown | Basic`
+ sympy/stats/symbolic_probability.py:533:55: error[unresolved-attribute] Attribute `expand` is not defined on `Basic` in union `Basic | Unknown`
+ sympy/stats/tests/test_symbolic_multivariate.py:85:36: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/stats/tests/test_symbolic_multivariate.py:85:84: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/stats/tests/test_symbolic_multivariate.py:86:36: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/tensor/tests/test_tensor.py:1694:19: error[unsupported-operator] Operator `+` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/tensor/tests/test_tensor.py:1695:23: error[unsupported-operator] Operator `-` is not supported between two objects of type `MutableDenseMatrix`
- Found 16080 diagnostics
+ Found 16169 diagnostics

rotki (https://github.com/rotki/rotki)
- rotkehlchen/tests/unit/test_makerdao.py:170:9: error[invalid-argument-type] Argument is incorrect: Expected `defaultdict[Asset, defaultdict[str, Balance]]`, found `defaultdict[Asset | Unknown, defaultdict[str, Balance] | Balance | dict[Unknown | str, Unknown | Balance] | Unknown]`
+ rotkehlchen/tests/unit/test_makerdao.py:170:9: error[invalid-argument-type] Argument is incorrect: Expected `defaultdict[Asset, defaultdict[str, Balance]]`, found `defaultdict[Asset | Unknown, defaultdict[str, Balance] | Balance | Unknown | dict[Unknown | str, Unknown | Balance]]`
- rotkehlchen/tests/unit/test_makerdao.py:171:9: error[invalid-argument-type] Argument is incorrect: Expected `defaultdict[Asset, defaultdict[str, Balance]]`, found `defaultdict[Asset | Unknown, defaultdict[str, Balance] | Balance | dict[Unknown | str, Unknown | Balance] | Unknown]`
+ rotkehlchen/tests/unit/test_makerdao.py:171:9: error[invalid-argument-type] Argument is incorrect: Expected `defaultdict[Asset, defaultdict[str, Balance]]`, found `defaultdict[Asset | Unknown, defaultdict[str, Balance] | Balance | Unknown | dict[Unknown | str, Unknown | Balance]]`

scikit-learn (https://github.com/scikit-learn/scikit-learn)
- sklearn/datasets/_lfw.py:469:60: error[invalid-argument-type] Argument to class `str` is incorrect: Expected `bytes | bytearray`, found `Unknown | str`
+ sklearn/datasets/_lfw.py:469:60: error[invalid-argument-type] Argument to class `str` is incorrect: Expected `bytes | bytearray`, found `str | Unknown`
- sklearn/externals/array_api_compat/common/_linalg.py:113:15: error[unresolved-attribute] Attribute `max` is not defined on `tuple[Any, ...]` in union `Any | tuple[Any, ...]`
+ sklearn/externals/array_api_compat/common/_linalg.py:113:15: error[unresolved-attribute] Attribute `max` is not defined on `tuple[Any, ...]` in union `tuple[Any, ...] | Any`
- sklearn/externals/array_api_compat/common/_linalg.py:113:76: error[unresolved-attribute] Attribute `dtype` is not defined on `tuple[Any, ...]` in union `Any | tuple[Any, ...]`
+ sklearn/externals/array_api_compat/common/_linalg.py:113:76: error[unresolved-attribute] Attribute `dtype` is not defined on `tuple[Any, ...]` in union `tuple[Any, ...] | Any`
- sklearn/externals/array_api_compat/common/_linalg.py:117:15: error[unresolved-attribute] Attribute `max` is not defined on `tuple[Any, ...]` in union `Any | tuple[Any, ...]`
+ sklearn/externals/array_api_compat/common/_linalg.py:117:15: error[unresolved-attribute] Attribute `max` is not defined on `tuple[Any, ...]` in union `tuple[Any, ...] | Any`

jax (https://github.com/google/jax)
- jax/_src/export/_export.py:1378:45: error[invalid-argument-type] Argument to function `_get_named_sharding` is incorrect: Expected `ShapedArray`, found `AbstractValue | Unknown`
+ jax/_src/export/_export.py:1378:45: error[invalid-argument-type] Argument to function `_get_named_sharding` is incorrect: Expected `ShapedArray`, found `Unknown | AbstractValue`
- jax/_src/pallas/hlo_interpreter.py:433:37: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `int | Unknown | DynamicGridDim`
+ jax/_src/pallas/hlo_interpreter.py:433:37: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `int | DynamicGridDim | Unknown`
- jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1934:37: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `int | Unknown | DynamicGridDim`
+ jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1934:37: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `int | DynamicGridDim | Unknown`
- jax/_src/pallas/pallas_call.py:862:37: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `int | Unknown | DynamicGridDim`
+ jax/_src/pallas/pallas_call.py:862:37: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `int | DynamicGridDim | Unknown`
- jax/collect_profile.py:110:17: error[unresolved-attribute] Attribute `glob` is not defined on `PathLike[str]`, `int`, `str`, `bytes`, `PathLike[bytes]` in union `Unknown | PathLike[str] | int | ... omitted 3 union elements`
+ jax/collect_profile.py:110:17: error[unresolved-attribute] Attribute `glob` is not defined on `PathLike[str]`, `int`, `str`, `bytes`, `PathLike[bytes]` in union `PathLike[str] | Unknown | int | ... omitted 3 union elements`
- jax/collect_profile.py:113:22: error[unsupported-operator] Operator `/` is not supported between objects of type `Unknown | PathLike[str] | int | ... omitted 3 union elements` and `Literal["remote.trace.json.gz"]`
+ jax/collect_profile.py:113:22: error[unsupported-operator] Operator `/` is not supported between objects of type `PathLike[str] | Unknown | int | ... omitted 3 union elements` and `Literal["remote.trace.json.gz"]`

core (https://github.com/home-assistant/core)
- homeassistant/helpers/device_registry.py:497:54: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- homeassistant/helpers/device_registry.py:502:58: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- homeassistant/helpers/device_registry.py:504:34: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ homeassistant/helpers/device_registry.py:1503:21: error[invalid-argument-type] Argument is incorrect: Expected `Iterable[_T@set]`, found `set[Unknown | tuple[Any, ...]]`
- homeassistant/helpers/entity_registry.py:1244:13: error[invalid-argument-type] Argument is incorrect: Expected `str`, found `None | str`
- homeassistant/helpers/entity_registry.py:1248:13: error[invalid-argument-type] Argument is incorrect: Expected `ReadOnlyEntityOptionsType`, found `Mapping[str, Mapping[str, Any]] | None`
- Found 11990 diagnostics
+ Found 11986 diagnostics

@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 27, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@ntBre ntBre added the ty Multi-file analysis & type inference label Feb 27, 2026
@AlexWaygood AlexWaygood added the ci Related to internal CI tooling label Feb 27, 2026
@carljm
Copy link
Contributor

carljm commented Feb 27, 2026

Thanks @WillDuke for working on improving this!

It seems to me that having the same line(s) show up as both e.g. "true positives added" and "true positives removed" is pretty confusing. I would rather have a separate "diagnostics changed" section where we give the diff for any line which didn't change true/false positive status, but where the diagnostic is now different.

Will this PR also fix the issue observed just now in #23611, where a line went from one false positive to two false positives, resulting in a "1 added false positive" in the summary table, but no details below? I think in that case it could also just show up in "diagnostics changed", since the line did not change status.

(This should maybe be separate, but while I'm wishing for features, it would be awesome if this job were to notify us if a PR moves an entire conformance-suite file into -- or I guess out of -- fully-passing state.)

This job is already a massive improvement over what we had before, thank you so much!

@WillDuke
Copy link
Contributor Author

WillDuke commented Feb 28, 2026

Thanks, Carl! Yeah, I wasn't sure how best to render the changed ones. Maybe a wider table that has both versions? Or perhaps just show the new diagnostics?

And yes, this would fix that issue. At least, it would now show one row under each of false positives removed and false positives added with the latter having two grouped diagnostics in the same confusing way as seen here.

I can also look at adding a file-level summary!

Edit: I went ahead and tried one approach: changed diagnostics get their own table with rows alternating between the diagnostics removed and added for each test case. The current conformance comment has updated to reflect these changes. The changes I added to demonstrate the fix didn't cause a new file to fully pass, but they will be listed now with this change.

Given the confusion that the other approach was causing, I've changed the metrics to count test cases rather than diagnostics. This means that you wont see spurious regressions appearing in the summary table when in fact ty's performance on the test cases improved. However, you will also not see any change in the summary table if e.g. false positive diagnostics were removed without changing the status of the test case. You would have to expand the false positives changed tab to see that some of the false positive diagnostics had been removed.

@carljm
Copy link
Contributor

carljm commented Mar 2, 2026

The latest conformance comment here looks pretty good to me -- curious what others think. @AlexWaygood ?

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Haven't done a detailed review of the code, but the output looks great on this PR's comment! A copule of nits:

display = f"{filename}:{min_line}:{max_line}"

rowspan_attr = f' rowspan="{rowspan}"' if rowspan > 1 else ""
return f'<td{rowspan_attr} align="center" valign="middle"><a href="{url}">{display}</a></td>'
Copy link
Member

Choose a reason for hiding this comment

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

I actually don't love the centre-aligned formatting... and it looks like it might be making GitHub render the table slightly smaller than it normally would?

@AlexWaygood
Copy link
Member

AlexWaygood commented Mar 3, 2026

Here's what the "True positives changed table looks like currently:

Details
Test caseΔLocationNameMessage
dataclasses_transform_converter.py:121-121:11invalid-argument-typeArgument is incorrect: Expected `int`, found `Literal["f0"]`
121:17invalid-argument-typeArgument is incorrect: Expected `int`, found `Literal["f1"]`
121:23invalid-argument-typeArgument is incorrect: Expected `int`, found `Literal["f2"]`
121:29invalid-argument-typeArgument is incorrect: Expected `ConverterClass`, found `Literal["f6"]`
121:35invalid-argument-typeArgument is incorrect: Expected `int`, found `Literal["1"]`
121:40invalid-argument-typeArgument is incorrect: Expected `dict[str, str]`, found `tuple[tuple[Literal["a"], Literal["1"]], tuple[Literal["b"], Literal["2"]]]`
+121:40invalid-argument-typeArgument is incorrect: Expected `dict[str, str]`, found `tuple[tuple[Literal["a"], Literal["1"]], tuple[Literal["b"], Literal["2"]]]`

I wonder if we actually need such fancy rendering for that table? Just a two-column table that shows the line (with a hyperlink) on the first column and the raw diff for that line in the second column would present the information more concisely, and possibly more readably?

Details
Test case Diff

dataclasses_transform_converter.py:121

-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]`
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]`
-error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal[b"f3"]`
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `list[Unknown]`
+error[invalid-argument-type] Argument is incorrect: Expected `str`, found `Literal[1]`

I made that table with a pretty unholy mixture of HTML and MarkDown -- here's the source for it 😆

Details
<table>

<tr>
<th>Test case</th>
<th>Diff</th>
</tr>

<tr>

<td>

[dataclasses_transform_converter.py:121](https://github.com/python/typing/blob/e9fccc9dbbd8f1e8b24b4f88911c3d3155059e2a/conformance/tests/dataclasses_transform_converter.py#L121)

</td>

<td>

```diff
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]`
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]`
-error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal[b"f3"]`
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `list[Unknown]`
+error[invalid-argument-type] Argument is incorrect: Expected `str`, found `Literal[1]`
```

</td>
</table>

@WillDuke
Copy link
Contributor Author

WillDuke commented Mar 4, 2026

Before I started this I didn't know that I could merge cells in an html table in a comment, and I definitely didn't know that the diffs would render in a cell! Dredging the depths of what's possible in Github-flavored markdown 😄.

I've tried to address each of those items. Let me know what you think.

@AlexWaygood
Copy link
Member

Awesome, thank you!! I think you'll have to fixup the merge conflicts (probably caused by me...) before CI will run again, unfortunately

@AlexWaygood
Copy link
Member

I ran the script on this branch locally in lieu of a CI run, and here's what it gave me:


Typing conformance results improved 🎉

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 774 775 +1 ⏫ (✅)
False Positives 126 122 -4 ⏬ (✅)
False Negatives 268 267 -1 ⏬ (✅)
Total Diagnostics 969 946 -23
Precision 86.00% 86.40% +0.40% ⏫ (✅)
Recall 74.28% 74.38% +0.10% ⏫ (✅)

Files changed

File True Positives False Positives False Negatives Status
dataclasses_transform_converter.py 9 (+1) ✅ 2 (-4) ✅ 0 (-1) ✅ 📈 Improving
Total (all files) 775 (+1) ✅ 122 (-4) ✅ 267 (-1) ✅ 55/131

True positives added (1)

1 diagnostic
Test case Diff

dataclasses_transform_converter.py:118

+error[invalid-assignment] Object of type `Literal[1]` is not assignable to attribute `field0` of type `str`

False positives removed (4)

4 diagnostics
Test case Diff

dataclasses_transform_converter.py:112

-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f0"]`
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]`
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]`
-error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal[b"f6"]`
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `list[Unknown]`

dataclasses_transform_converter.py:114

-error[invalid-assignment] Object of type `Literal["f1"]` is not assignable to attribute `field0` of type `int`

dataclasses_transform_converter.py:115

-error[invalid-assignment] Object of type `Literal["f6"]` is not assignable to attribute `field3` of type `ConverterClass`

dataclasses_transform_converter.py:116

-error[invalid-assignment] Object of type `Literal[b"f6"]` is not assignable to attribute `field3` of type `ConverterClass`

True positives changed (4)

4 diagnostics
Test case Diff

dataclasses_transform_converter.py:107

-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]`
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]`
-error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal[b"f3"]`
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `list[Unknown]`
+error[invalid-argument-type] Argument is incorrect: Expected `str`, found `Literal[1]`

dataclasses_transform_converter.py:108

-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f0"]`
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]`
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]`
-error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal[1]`
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `list[Unknown]`
+error[invalid-argument-type] Argument is incorrect: Expected `str \| bytes`, found `Literal[1]`

dataclasses_transform_converter.py:109

-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f0"]`
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]`
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]`
-error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal["f3"]`
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `complex`
+error[invalid-argument-type] Argument is incorrect: Expected `str \| list[str]`, found `complex`

dataclasses_transform_converter.py:119

-error[invalid-assignment] Object of type `Literal[1]` is not assignable to attribute `field3` of type `ConverterClass`
+error[invalid-assignment] Object of type `Literal[1]` is not assignable to attribute `field3` of type `str \| bytes`

False positives changed (1)

1 diagnostic
Test case Diff

dataclasses_transform_converter.py:121

-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f0"]`
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]`
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]`
-error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal["f6"]`
-error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["1"]`
-error[invalid-argument-type] Argument is incorrect: Expected `dict[str, str]`, found `tuple[tuple[Literal["a"], Literal["1"]], tuple[Literal["b"], Literal["2"]]]`
+error[invalid-argument-type] Argument is incorrect: Expected `dict[str, str]`, found `tuple[tuple[Literal["a"], Literal["1"]], tuple[Literal["b"], Literal["2"]]]`

Which looks awesome. Happy to merge once the unrelated dataclass_transform changes are dropped!

@AlexWaygood AlexWaygood force-pushed the wld/render-all-conformance-changes branch from 0da638a to b9a6b5a Compare March 5, 2026 19:13
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Love it -- thanks!

@AlexWaygood AlexWaygood enabled auto-merge (squash) March 5, 2026 19:14
@AlexWaygood AlexWaygood merged commit 69c23cc into astral-sh:main Mar 5, 2026
43 checks passed
@WillDuke
Copy link
Contributor Author

WillDuke commented Mar 5, 2026

@AlexWaygood Sorry, it's been a busy week for me. Thanks for taking it home!

carljm added a commit that referenced this pull request Mar 5, 2026
* main:
  Update conformance suite commit hash (#23746)
  conformance.py: Collapse the summary paragraph when nothing changed (#23745)
  [ty] Make inferred specializations line up with source types more better (#23715)
  Bump 0.15.5 (#23743)
  [ty] Render all changed diagnostics in conformance.py (#23613)
  [ty] Split deferred checks out of `types/infer/builder.rs` (#23740)
  Discover markdown files by default in preview mode (#23434)
  [ty] Use `HasOptionalDefinition` for `except` handlers (#23739)
  [ty] Fix precedence of `all` selector in TOML configurations (#23723)
  [ty] Make `all` selector case sensitive (#23713)
  [ty] Add a diagnostic if a `TypeVar` is used to specialize a `ParamSpec`, or vice versa (#23738)
  [ty] Override home directory in ty tests (#23724)
  [ty] More type-variable default validation (#23639)
  [ty] Validate bare ParamSpec usage in type annotations, and support stringified ParamSpecs as the first argument to `Callable` (#23625)
  [ty] Add `all` selector to ty.json's `schema` (#23721)
  [ty] Add quotes to related issues links (#23720)
  [ty] Fix panic on incomplete except handlers (#23708)
@WillDuke WillDuke deleted the wld/render-all-conformance-changes branch March 6, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Related to internal CI tooling ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

conformance.py: also list diagnostics where the location remained the same but the code/error message changed

4 participants