From 0b1d8b38ab561206cfb2f728ce7f445d7f758e1d Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 26 Mar 2026 17:04:47 +0000 Subject: [PATCH 1/2] Update ty results for v0.0.26 --- conformance/results/results.html | 26 ++++----- conformance/results/ty/aliases_explicit.toml | 7 ++- conformance/results/ty/aliases_implicit.toml | 4 +- .../results/ty/annotations_generators.toml | 19 +++---- .../results/ty/callables_annotation.toml | 14 ++--- .../ty/dataclasses_transform_converter.toml | 55 ++++++------------- .../results/ty/directives_type_checking.toml | 8 +-- .../results/ty/directives_type_ignore.toml | 8 ++- conformance/results/ty/generics_basic.toml | 2 +- .../results/ty/generics_paramspec_basic.toml | 3 +- .../ty/generics_paramspec_components.toml | 6 +- .../ty/generics_paramspec_semantics.toml | 22 +++----- .../results/ty/generics_self_usage.toml | 10 ++-- .../results/ty/typeddicts_extra_items.toml | 50 ++++++++--------- .../results/ty/typeddicts_operations.toml | 6 +- .../ty/typeddicts_readonly_update.toml | 5 +- .../ty/typeddicts_type_consistency.toml | 2 +- conformance/results/ty/typeddicts_usage.toml | 4 +- conformance/results/ty/version.toml | 2 +- conformance/uv.lock | 36 ++++++------ 20 files changed, 127 insertions(+), 162 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index 44628376a..be7ffd26d 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -180,7 +180,7 @@

Python Type System Conformance Test Results

pyrefly 0.56.0
-
ty 0.0.22
+
ty 0.0.26
@@ -205,7 +205,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unsupported +Pass      annotations_methods
Pass*

Type evaluation differs from other type checkers because of ambiguity in the spec related to method bindings.

@@ -312,21 +312,21 @@

Python Type System Conformance Test Results

Pass Pass Pass -
Partial

Does not reject using a bare `ParamSpec` as a type alias value.

Does not support `Concatenate`.

+
Partial

Does not reject using a bare `ParamSpec` as a type alias value.

     generics_paramspec_components Pass Pass Pass
Partial

Does not reject usage of args/kwargs for out-of-scope ParamSpec

-
Partial

Incorrectly allows using `*args: P.args` and `**kwargs: P.kwargs` when `P` has not been put into scope by any other parameter annotation or enclosing scope.

Does not support `Concatenate`.

+
Partial

Incorrectly allows using `*args: P.args` and `**kwargs: P.kwargs` when `P` has not been put into scope by any other parameter annotation or enclosing scope.

     generics_paramspec_semantics Pass
Pass*

Constraint solver doesn't find common type for two signatures captured by a single ParamSpec (allowed).

Pass Pass -
Partial

Does not support `Concatenate`.

+Pass      generics_paramspec_specialization Pass @@ -375,7 +375,7 @@

Python Type System Conformance Test Results

Pass Pass
Partial

Does not implement some restrictions on where Self can be used

-
Partial

Does not reject `Self` used in a return annotation when `self` is annotated using another type variable.

Does not reject `Self` used in staticmethods or metaclasses.

+
Partial

Does not reject `Self` used in a return annotation when `self` is annotated using another type variable.

     generics_syntax_compatibility Pass @@ -531,14 +531,14 @@

Python Type System Conformance Test Results

Pass Pass Pass -
Partial

`Concatenate` in type aliases is currently unsupported

+
Partial

Does not emit a diagnostic on an invalid use of a variable as the right-hand side of a type alias.

Does not emit a diagnostic if a type alias to a union, in which every element of the union is implicitly specialized with `Unknown`, is invalidly specialized again.

     aliases_implicit Pass Pass Pass
Partial

Does not reject invalid syntax in implicit type aliases.

-
Partial

Does not reject variables with `Any` or `Unknown` types when used as implicit type aliases.

Does not support `Concatenate` in type aliases.

+
Partial

Does not reject variables with `Any` or `Unknown` types when used as implicit type aliases.

Falls short on full syntactic validation of type aliases.

     aliases_newtype
Partial

`NewType`s are incorrectly considered to be classes.

@@ -694,7 +694,7 @@

Python Type System Conformance Test Results

Pass Pass
Partial

Parameter names are lost when resolving ParamSpec

-
Partial

Does not support `Concatenate`.

Infers a callback protocol as being a gradual type if the callback has signature `__call__[T](self, *args: T, **kwargs: T)` and `T` has been explicitly specialized to `Any`.

Does not infer a callback protocol as being a gradual type if the callback has signature `__call__(self, a: int, /, *args: Any, **kwargs: Any)`.

+
Partial

Infers a callback protocol as being a gradual type if the callback has signature `__call__[T](self, *args: T, **kwargs: T)` and `T` has been explicitly specialized to `Any`.

     callables_kwargs
Partial

Allows callable without kwargs to be assigned to callable with unpacked kwargs

@@ -895,7 +895,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unsupported +
Pass*

Does not pass all assertions in the test file, due to limitations in ty's generics solver.

Incorrectly rejects a converter of `dict` combined with a default of `()`.

Incorrectly rejects passing a sequence of two-element string tuples to the `dict` constructor.

     dataclasses_transform_field
Partial

Does not properly handle field constructor that has default value for `kw_only` or `init` parameter.

@@ -1003,7 +1003,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unsupported +Pass      typeddicts_required Pass @@ -1186,14 +1186,14 @@

Python Type System Conformance Test Results

Pass Pass Pass -
Partial

Attempts to detect some errors even in blocks it determines to be unreachable, including in `if not TYPE_CHECKING` blocks.

+Pass      directives_type_ignore
Partial

Does not honor "# type: ignore" comment if comment includes additional text.

Pass
Partial

Does not honor "# type: ignore" comment if comment includes additional text.

Pass -Pass +
Partial

Treats `# type: ignore[error-code]` as only ignoring errors that match the error code `error-code`.

     directives_type_ignore_file1 Pass diff --git a/conformance/results/ty/aliases_explicit.toml b/conformance/results/ty/aliases_explicit.toml index 07ed552a6..5d642b104 100644 --- a/conformance/results/ty/aliases_explicit.toml +++ b/conformance/results/ty/aliases_explicit.toml @@ -1,13 +1,14 @@ conformance_automated = "Fail" conformant = "Partial" -notes = "`Concatenate` in type aliases is currently unsupported" +notes = """ +Does not emit a diagnostic on an invalid use of a variable as the right-hand side of a type alias. +Does not emit a diagnostic if a type alias to a union, in which every element of the union is implicitly specialized with `Unknown`, is invalidly specialized again. +""" errors_diff = """ Line 87: Expected 1 errors Line 100: Expected 1 errors -Line 57: Unexpected errors ['aliases_explicit.py:57:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `(int, str, str, /) -> None`'] """ output = """ -aliases_explicit.py:57:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `(int, str, str, /) -> None` aliases_explicit.py:67:9: error[not-subscriptable] Cannot subscript non-generic type `` aliases_explicit.py:68:9: error[not-subscriptable] Cannot subscript non-generic type `` aliases_explicit.py:69:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2 diff --git a/conformance/results/ty/aliases_implicit.toml b/conformance/results/ty/aliases_implicit.toml index bda018615..1e6940353 100644 --- a/conformance/results/ty/aliases_implicit.toml +++ b/conformance/results/ty/aliases_implicit.toml @@ -2,7 +2,7 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ Does not reject variables with `Any` or `Unknown` types when used as implicit type aliases. -Does not support `Concatenate` in type aliases. +Falls short on full syntactic validation of type aliases. """ errors_diff = """ Line 106: Expected 1 errors @@ -10,10 +10,8 @@ Line 111: Expected 1 errors Line 112: Expected 1 errors Line 113: Expected 1 errors Line 117: Expected 1 errors -Line 68: Unexpected errors ['aliases_implicit.py:68:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `(int, str, str, /) -> None`'] """ output = """ -aliases_implicit.py:68:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `(int, str, str, /) -> None` aliases_implicit.py:76:9: error[not-subscriptable] Cannot subscript non-generic type `` aliases_implicit.py:77:9: error[not-subscriptable] Cannot subscript non-generic type `` aliases_implicit.py:78:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2 diff --git a/conformance/results/ty/annotations_generators.toml b/conformance/results/ty/annotations_generators.toml index f2b2b5e27..1f05f0b0b 100644 --- a/conformance/results/ty/annotations_generators.toml +++ b/conformance/results/ty/annotations_generators.toml @@ -1,16 +1,15 @@ -conformance_automated = "Fail" -conformant = "Unsupported" +conformance_automated = "Pass" errors_diff = """ -Line 51: Expected 1 errors -Line 54: Expected 1 errors -Line 57: Expected 1 errors -Line 66: Expected 1 errors -Line 75: Expected 1 errors -Line 118: Expected 1 errors -Line 119: Expected 1 errors -Line 135: Expected 1 errors """ output = """ +annotations_generators.py:51:21: error[invalid-return-type] Function can implicitly return `None`, which is not assignable to return type `C` +annotations_generators.py:54:16: error[invalid-return-type] Return type does not match returned value: expected `C`, found `Literal[False]` +annotations_generators.py:57:15: error[invalid-yield] Yield type `Literal[3]` does not match annotated yield type `A` +annotations_generators.py:66:15: error[invalid-yield] Yield type `Literal[3]` does not match annotated yield type `A` +annotations_generators.py:75:11: error[invalid-yield] Yield type `B` does not match annotated yield type `A` annotations_generators.py:86:21: error[invalid-return-type] Return type does not match returned value: expected `int`, found `types.GeneratorType` annotations_generators.py:91:27: error[invalid-return-type] Return type does not match returned value: expected `int`, found `types.AsyncGeneratorType` +annotations_generators.py:118:16: error[invalid-yield] Yield type `A` does not match annotated yield type `B` +annotations_generators.py:119:16: error[invalid-yield] Yield type `int` does not match annotated yield type `B` +annotations_generators.py:135:16: error[invalid-yield] Send type `int` does not match annotated send type `str` """ diff --git a/conformance/results/ty/callables_annotation.toml b/conformance/results/ty/callables_annotation.toml index aa616994b..1be55c1ca 100644 --- a/conformance/results/ty/callables_annotation.toml +++ b/conformance/results/ty/callables_annotation.toml @@ -1,18 +1,10 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ -Does not support `Concatenate`. Infers a callback protocol as being a gradual type if the callback has signature `__call__[T](self, *args: T, **kwargs: T)` and `T` has been explicitly specialized to `Any`. -Does not infer a callback protocol as being a gradual type if the callback has signature `__call__(self, a: int, /, *args: Any, **kwargs: Any)`. """ errors_diff = """ -Line 91: Expected 1 errors -Line 93: Expected 1 errors Line 159: Expected 1 errors -Line 172: Expected 1 errors -Line 187: Expected 1 errors -Line 189: Expected 1 errors -Line 157: Unexpected errors ['callables_annotation.py:157:20: error[invalid-assignment] Object of type `Proto7` is not assignable to `Proto6`'] """ output = """ callables_annotation.py:25:5: error[missing-argument] No argument provided for required parameter 2 @@ -29,5 +21,9 @@ callables_annotation.py:57:18: error[invalid-type-form] List literals are not al callables_annotation.py:58:5: error[invalid-type-form] Special form `typing.Callable` expected exactly two arguments (parameter types and return type) callables_annotation.py:58:14: error[invalid-type-form] The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...` callables_annotation.py:59:14: error[invalid-type-form] `[...]` is not a valid parameter list for `Callable`: Did you mean `Callable[..., int]`? -callables_annotation.py:157:20: error[invalid-assignment] Object of type `Proto7` is not assignable to `Proto6` +callables_annotation.py:91:7: error[invalid-assignment] Object of type `def test_cb2() -> str` is not assignable to `(int, /, *args: Any, **kwargs: Any) -> str` +callables_annotation.py:93:7: error[invalid-assignment] Object of type `def test_cb4(*, a: int) -> str` is not assignable to `(int, /, *args: Any, **kwargs: Any) -> str` +callables_annotation.py:172:26: error[invalid-assignment] Object of type `() -> str` is not assignable to `(int, /, *args: Any, **kwargs: Any) -> str` +callables_annotation.py:187:48: error[invalid-assignment] Object of type `(int, str, /) -> str` is not assignable to `(str, /, *args: Any, **kwargs: Any) -> str` +callables_annotation.py:189:32: error[invalid-assignment] Object of type `(int, str, /) -> str` is not assignable to `(str, /, *args: Any, **kwargs: Any) -> str` """ diff --git a/conformance/results/ty/dataclasses_transform_converter.toml b/conformance/results/ty/dataclasses_transform_converter.toml index c9e0e8394..87c98dfd5 100644 --- a/conformance/results/ty/dataclasses_transform_converter.toml +++ b/conformance/results/ty/dataclasses_transform_converter.toml @@ -1,47 +1,28 @@ -conformance_automated = "Fail" -conformant = "Unsupported" +conformance_automated = "Pass" +conformant = "Pass" +notes = """ +Does not pass all assertions in the test file, due to limitations in ty's generics solver. + +Incorrectly rejects a converter of `dict` combined with a default of `()`. +Incorrectly rejects passing a sequence of two-element string tuples to the `dict` constructor. +""" +ignore_errors = [ + "Object of type `dict[str, str] | dict[bytes, bytes]` is not assignable to `dict[str, str]`", + "Argument to function `model_field` is incorrect: Expected `(Iterable[list[str]] | Iterable[list[bytes]], /) -> dict[str, str] | dict[bytes, bytes]`, found ``", + "Argument is incorrect: Expected `dict[str, str]`, found `tuple[tuple[Literal[\"a\"], Literal[\"1\"]], tuple[Literal[\"b\"], Literal[\"2\"]]]`", +] errors_diff = """ -Line 118: Expected 1 errors -Line 104: Unexpected errors ['dataclasses_transform_converter.py:104:30: error[invalid-assignment] Object of type `dict[str, str] | dict[bytes, bytes]` is not assignable to `dict[str, str]`', "dataclasses_transform_converter.py:104:42: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(Iterable[list[str]] | Iterable[list[bytes]], /) -> dict[str, str] | dict[bytes, bytes]`, found ``"] -Line 112: Unexpected errors ['dataclasses_transform_converter.py:112:11: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f0"]`', 'dataclasses_transform_converter.py:112:17: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]`', 'dataclasses_transform_converter.py:112:23: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]`', 'dataclasses_transform_converter.py:112:29: error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal[b"f6"]`', 'dataclasses_transform_converter.py:112:36: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `list[Unknown]`'] -Line 114: Unexpected errors ['dataclasses_transform_converter.py:114:1: error[invalid-assignment] Object of type `Literal["f1"]` is not assignable to attribute `field0` of type `int`'] -Line 115: Unexpected errors ['dataclasses_transform_converter.py:115:1: error[invalid-assignment] Object of type `Literal["f6"]` is not assignable to attribute `field3` of type `ConverterClass`'] -Line 116: Unexpected errors ['dataclasses_transform_converter.py:116:1: error[invalid-assignment] Object of type `Literal[b"f6"]` is not assignable to attribute `field3` of type `ConverterClass`'] -Line 121: Unexpected errors ['dataclasses_transform_converter.py:121:11: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f0"]`', 'dataclasses_transform_converter.py:121:17: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]`', 'dataclasses_transform_converter.py:121:23: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]`', 'dataclasses_transform_converter.py:121:29: error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal["f6"]`', 'dataclasses_transform_converter.py:121:35: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["1"]`', 'dataclasses_transform_converter.py:121:40: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, str]`, found `tuple[tuple[Literal["a"], Literal["1"]], tuple[Literal["b"], Literal["2"]]]`'] """ output = """ dataclasses_transform_converter.py:48:31: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(Unknown, /) -> Unknown`, found `def bad_converter1() -> int` dataclasses_transform_converter.py:49:31: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(Unknown, /) -> Unknown`, found `def bad_converter2(*, x: int) -> int` dataclasses_transform_converter.py:104:30: error[invalid-assignment] Object of type `dict[str, str] | dict[bytes, bytes]` is not assignable to `dict[str, str]` dataclasses_transform_converter.py:104:42: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(Iterable[list[str]] | Iterable[list[bytes]], /) -> dict[str, str] | dict[bytes, bytes]`, found `` -dataclasses_transform_converter.py:107:8: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]` -dataclasses_transform_converter.py:107:14: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]` -dataclasses_transform_converter.py:107:20: error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal[b"f3"]` -dataclasses_transform_converter.py:107:27: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `list[Unknown]` -dataclasses_transform_converter.py:108:5: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f0"]` -dataclasses_transform_converter.py:108:11: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]` -dataclasses_transform_converter.py:108:17: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]` -dataclasses_transform_converter.py:108:23: error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal[1]` -dataclasses_transform_converter.py:108:26: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `list[Unknown]` -dataclasses_transform_converter.py:109:5: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f0"]` -dataclasses_transform_converter.py:109:11: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]` -dataclasses_transform_converter.py:109:17: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]` -dataclasses_transform_converter.py:109:23: error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal["f3"]` -dataclasses_transform_converter.py:109:29: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `complex` -dataclasses_transform_converter.py:112:11: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f0"]` -dataclasses_transform_converter.py:112:17: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]` -dataclasses_transform_converter.py:112:23: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]` -dataclasses_transform_converter.py:112:29: error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal[b"f6"]` -dataclasses_transform_converter.py:112:36: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `list[Unknown]` -dataclasses_transform_converter.py:114:1: error[invalid-assignment] Object of type `Literal["f1"]` is not assignable to attribute `field0` of type `int` -dataclasses_transform_converter.py:115:1: error[invalid-assignment] Object of type `Literal["f6"]` is not assignable to attribute `field3` of type `ConverterClass` -dataclasses_transform_converter.py:116:1: error[invalid-assignment] Object of type `Literal[b"f6"]` is not assignable to attribute `field3` of type `ConverterClass` -dataclasses_transform_converter.py:119:1: error[invalid-assignment] Object of type `Literal[1]` is not assignable to attribute `field3` of type `ConverterClass` -dataclasses_transform_converter.py:121:11: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f0"]` -dataclasses_transform_converter.py:121:17: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]` -dataclasses_transform_converter.py:121:23: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]` -dataclasses_transform_converter.py:121:29: error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal["f6"]` -dataclasses_transform_converter.py:121:35: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["1"]` +dataclasses_transform_converter.py:107:5: error[invalid-argument-type] Argument is incorrect: Expected `str`, found `Literal[1]` +dataclasses_transform_converter.py:108:23: error[invalid-argument-type] Argument is incorrect: Expected `str | bytes`, found `Literal[1]` +dataclasses_transform_converter.py:109:29: error[invalid-argument-type] Argument is incorrect: Expected `str | list[str]`, found `complex` +dataclasses_transform_converter.py:118:1: error[invalid-assignment] Object of type `Literal[1]` is not assignable to attribute `field0` of type `str` +dataclasses_transform_converter.py:119:1: error[invalid-assignment] Object of type `Literal[1]` is not assignable to attribute `field3` of type `str | bytes` dataclasses_transform_converter.py:121:40: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, str]`, found `tuple[tuple[Literal["a"], Literal["1"]], tuple[Literal["b"], Literal["2"]]]` dataclasses_transform_converter.py:130:31: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(str | Literal[1], /) -> int`, found `def converter_simple(s: str) -> int` dataclasses_transform_converter.py:133:31: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(str | int, /) -> int`, found `def converter_simple(s: str) -> int` diff --git a/conformance/results/ty/directives_type_checking.toml b/conformance/results/ty/directives_type_checking.toml index a9ad6809b..cdd4d0cd9 100644 --- a/conformance/results/ty/directives_type_checking.toml +++ b/conformance/results/ty/directives_type_checking.toml @@ -1,11 +1,5 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Attempts to detect some errors even in blocks it determines to be unreachable, including in `if not TYPE_CHECKING` blocks. -""" +conformance_automated = "Pass" errors_diff = """ -Line 11: Unexpected errors ['directives_type_checking.py:11:14: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int`'] """ output = """ -directives_type_checking.py:11:14: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` """ diff --git a/conformance/results/ty/directives_type_ignore.toml b/conformance/results/ty/directives_type_ignore.toml index cdd4d0cd9..df3a5011d 100644 --- a/conformance/results/ty/directives_type_ignore.toml +++ b/conformance/results/ty/directives_type_ignore.toml @@ -1,5 +1,11 @@ -conformance_automated = "Pass" +conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Treats `# type: ignore[error-code]` as only ignoring errors that match the error code `error-code`. +""" errors_diff = """ +Line 14: Unexpected errors ['directives_type_ignore.py:14:10: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int`'] """ output = """ +directives_type_ignore.py:14:10: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` """ diff --git a/conformance/results/ty/generics_basic.toml b/conformance/results/ty/generics_basic.toml index cfeb943c2..463ed0f7d 100644 --- a/conformance/results/ty/generics_basic.toml +++ b/conformance/results/ty/generics_basic.toml @@ -18,5 +18,5 @@ generics_basic.py:162:12: error[invalid-argument-type] `` is not a generics_basic.py:163:12: error[invalid-argument-type] `` is not a valid argument to `Protocol` generics_basic.py:171:1: error[invalid-generic-class] `Generic` base class must include all type variables used in other base classes generics_basic.py:172:1: error[invalid-generic-class] `Generic` base class must include all type variables used in other base classes -generics_basic.py:208:1: error[invalid-metaclass] Generic metaclasses are not supported +generics_basic.py:208:27: error[invalid-metaclass] Generic metaclasses are not supported """ diff --git a/conformance/results/ty/generics_paramspec_basic.toml b/conformance/results/ty/generics_paramspec_basic.toml index e9b05cfe9..d1e208c17 100644 --- a/conformance/results/ty/generics_paramspec_basic.toml +++ b/conformance/results/ty/generics_paramspec_basic.toml @@ -2,16 +2,15 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ Does not reject using a bare `ParamSpec` as a type alias value. -Does not support `Concatenate`. """ errors_diff = """ Line 15: Expected 1 errors -Line 27: Expected 1 errors """ output = """ generics_paramspec_basic.py:10:1: error[invalid-paramspec] The name of a `ParamSpec` (`NotIt`) must match the name of the variable it is assigned to (`WrongName`) generics_paramspec_basic.py:23:14: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression generics_paramspec_basic.py:23:20: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression +generics_paramspec_basic.py:27:14: error[invalid-type-form] `typing.Concatenate` is not allowed in this context in a type expression generics_paramspec_basic.py:31:19: error[invalid-type-arguments] ParamSpec `P` cannot be used to specialize type variable `_T` generics_paramspec_basic.py:35:35: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression generics_paramspec_basic.py:39:18: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression diff --git a/conformance/results/ty/generics_paramspec_components.toml b/conformance/results/ty/generics_paramspec_components.toml index fedff3330..21ef9bf9b 100644 --- a/conformance/results/ty/generics_paramspec_components.toml +++ b/conformance/results/ty/generics_paramspec_components.toml @@ -2,12 +2,9 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ Incorrectly allows using `*args: P.args` and `**kwargs: P.kwargs` when `P` has not been put into scope by any other parameter annotation or enclosing scope. -Does not support `Concatenate`. """ errors_diff = """ Line 30: Expected 1 errors -Line 70: Expected 1 errors -Line 72: Expected 1 errors """ output = """ generics_paramspec_components.py:17:25: error[invalid-type-form] `P.kwargs` is valid only in `**kwargs` annotation: Did you mean `P.args`? @@ -24,6 +21,9 @@ generics_paramspec_components.py:49:11: error[invalid-argument-type] Argument is generics_paramspec_components.py:49:20: error[invalid-argument-type] Argument is incorrect: Expected `P@decorator.kwargs`, found `P@decorator.args` generics_paramspec_components.py:51:11: error[invalid-argument-type] Argument is incorrect: Expected `P@decorator.args`, found `Literal[1]` generics_paramspec_components.py:60:28: error[invalid-paramspec] No parameters may appear between `*args: P.args` and `**kwargs: P.kwargs` +generics_paramspec_components.py:70:11: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `P@remove.args` +generics_paramspec_components.py:70:18: error[invalid-argument-type] Argument is incorrect: Expected `P@remove.args`, found `Literal[1]` +generics_paramspec_components.py:72:11: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `P@remove.args` generics_paramspec_components.py:83:18: error[invalid-argument-type] Argument to function `foo` is incorrect: Expected `int`, found `(...)` generics_paramspec_components.py:83:18: error[parameter-already-assigned] Multiple values provided for parameter 1 (`x`) of function `foo` generics_paramspec_components.py:98:20: error[invalid-argument-type] Argument to function `twice` is incorrect: Expected `int`, found `Literal["A"]` diff --git a/conformance/results/ty/generics_paramspec_semantics.toml b/conformance/results/ty/generics_paramspec_semantics.toml index b8806e5b9..2a84cbc37 100644 --- a/conformance/results/ty/generics_paramspec_semantics.toml +++ b/conformance/results/ty/generics_paramspec_semantics.toml @@ -1,16 +1,5 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not support `Concatenate`. -""" +conformance_automated = "Pass" errors_diff = """ -Line 98: Expected 1 errors -Line 120: Expected 1 errors -Line 127: Expected 1 errors -Line 132: Expected 1 errors -Line 137: Expected 1 errors -Line 106: Unexpected errors ['generics_paramspec_semantics.py:106:13: error[missing-argument] No argument provided for required parameter `**kwargs`'] -Line 107: Unexpected errors ['generics_paramspec_semantics.py:107:13: error[missing-argument] No arguments provided for required parameters `*args`, `**kwargs`'] """ output = """ generics_paramspec_semantics.py:26:4: error[positional-only-parameter-as-kwarg] Positional-only parameter 1 (`a`) passed as keyword argument @@ -18,7 +7,10 @@ generics_paramspec_semantics.py:26:11: error[positional-only-parameter-as-kwarg] generics_paramspec_semantics.py:27:9: error[invalid-argument-type] Argument is incorrect: Expected `bool`, found `Literal["A"]` generics_paramspec_semantics.py:46:17: error[invalid-argument-type] Argument to function `func1` is incorrect: Expected `(x: int, y: str) -> int`, found `def y_x(y: int, x: str) -> int` generics_paramspec_semantics.py:61:23: error[invalid-argument-type] Argument to function `func1` is incorrect: Expected `(*, x: int) -> int`, found `def keyword_only_y(*, y: int) -> int` -generics_paramspec_semantics.py:106:13: error[missing-argument] No argument provided for required parameter `**kwargs` -generics_paramspec_semantics.py:107:13: error[missing-argument] No arguments provided for required parameters `*args`, `**kwargs` -generics_paramspec_semantics.py:108:1: error[missing-argument] No argument provided for required parameter `**kwargs` +generics_paramspec_semantics.py:98:4: error[invalid-argument-type] Argument is incorrect: Expected `str`, found `Literal[1]` +generics_paramspec_semantics.py:108:4: error[invalid-argument-type] Argument is incorrect: Expected `bool`, found `Literal[1]` +generics_paramspec_semantics.py:120:4: error[invalid-argument-type] Argument is incorrect: Expected `str`, found `Literal[1]` +generics_paramspec_semantics.py:127:1: error[invalid-argument-type] Argument to function `expects_int_first` is incorrect: Expected `(int, /, *args: Unknown, **kwargs: Unknown) -> int`, found `def one(x: str) -> int` +generics_paramspec_semantics.py:132:1: error[invalid-argument-type] Argument to function `expects_int_first` is incorrect: Expected `(int, /, *args: Unknown, **kwargs: Unknown) -> int`, found `def two(*, x: int) -> int` +generics_paramspec_semantics.py:137:1: error[invalid-argument-type] Argument to function `expects_int_first` is incorrect: Expected `(int, /, *args: Unknown, **kwargs: Unknown) -> int`, found `def three(**kwargs: int) -> int` """ diff --git a/conformance/results/ty/generics_self_usage.toml b/conformance/results/ty/generics_self_usage.toml index 570bd1724..612a956fa 100644 --- a/conformance/results/ty/generics_self_usage.toml +++ b/conformance/results/ty/generics_self_usage.toml @@ -2,14 +2,9 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ Does not reject `Self` used in a return annotation when `self` is annotated using another type variable. -Does not reject `Self` used in staticmethods or metaclasses. """ errors_diff = """ Line 82: Expected 1 errors -Line 113: Expected 1 errors -Line 118: Expected 1 errors -Line 123: Expected 1 errors -Line 127: Expected 1 errors """ output = """ generics_self_usage.py:73:14: error[invalid-type-form] Variable of type `` is not allowed in a type expression @@ -19,4 +14,9 @@ generics_self_usage.py:87:16: error[invalid-return-type] Return type does not ma generics_self_usage.py:103:15: error[invalid-type-form] Variable of type `` is not allowed in a type expression generics_self_usage.py:105:12: error[invalid-base] Invalid class base with type `` generics_self_usage.py:108:30: error[invalid-type-form] Variable of type `` is not allowed in a type expression +generics_self_usage.py:113:19: error[invalid-type-form] `Self` cannot be used in a static method +generics_self_usage.py:118:31: error[invalid-type-form] `Self` cannot be used in a static method +generics_self_usage.py:118:40: error[invalid-type-form] `Self` cannot be used in a static method +generics_self_usage.py:123:37: error[invalid-type-form] `Self` cannot be used in a metaclass +generics_self_usage.py:127:42: error[invalid-type-form] `Self` cannot be used in a metaclass """ diff --git a/conformance/results/ty/typeddicts_extra_items.toml b/conformance/results/ty/typeddicts_extra_items.toml index 989146a4c..90ee73c42 100644 --- a/conformance/results/ty/typeddicts_extra_items.toml +++ b/conformance/results/ty/typeddicts_extra_items.toml @@ -21,22 +21,22 @@ Lines 94, 95: Expected error (tag 'MovieD') Lines 184, 185: Expected error (tag 'MovieRequiredYear') Lines 187, 188: Expected error (tag 'MovieNotRequiredYear') Lines 196, 197: Expected error (tag 'BookWithPublisher') -Line 14: Unexpected errors ['typeddicts_extra_items.py:14:37: error[invalid-key] Unknown key "novel_adaptation" for TypedDict `Movie`: Unknown key "novel_adaptation"'] -Line 29: Unexpected errors ['typeddicts_extra_items.py:29:5: error[type-assertion-failure] Type `str` does not match asserted type `bool`', 'typeddicts_extra_items.py:29:23: error[invalid-key] Unknown key "novel_adaptation" for TypedDict `Movie`: Unknown key "novel_adaptation"'] -Line 43: Unexpected errors ['typeddicts_extra_items.py:43:5: error[invalid-key] Unknown key "other_extra_key" for TypedDict `InheritedMovie`: Unknown key "other_extra_key"'] +Line 14: Unexpected errors ['typeddicts_extra_items.py:14:37: error[invalid-key] Unknown key "novel_adaptation" for TypedDict `Movie`'] +Line 29: Unexpected errors ['typeddicts_extra_items.py:29:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `bool`', 'typeddicts_extra_items.py:29:23: error[invalid-key] Unknown key "novel_adaptation" for TypedDict `Movie`'] +Line 43: Unexpected errors ['typeddicts_extra_items.py:43:5: error[invalid-key] Unknown key "other_extra_key" for TypedDict `InheritedMovie`'] Line 129: Unexpected errors ['typeddicts_extra_items.py:129:15: error[invalid-argument-type] Cannot delete unknown key "year" from TypedDict `MovieEI`'] -Line 254: Unexpected errors ['typeddicts_extra_items.py:254:63: error[invalid-key] Unknown key "year" for TypedDict `MovieExtraInt`: Unknown key "year"'] -Line 255: Unexpected errors ['typeddicts_extra_items.py:255:63: error[invalid-key] Unknown key "description" for TypedDict `MovieExtraStr`: Unknown key "description"'] -Line 266: Unexpected errors ['typeddicts_extra_items.py:266:64: error[invalid-key] Unknown key "year" for TypedDict `MovieExtraInt`: Unknown key "year"'] -Line 284: Unexpected errors ['typeddicts_extra_items.py:284:43: error[invalid-key] Unknown key "year" for TypedDict `ExtraMovie`: Unknown key "year"'] -Line 299: Unexpected errors ['typeddicts_extra_items.py:299:54: error[invalid-key] Unknown key "summary" for TypedDict `MovieExtraStr`: Unknown key "summary"'] +Line 254: Unexpected errors ['typeddicts_extra_items.py:254:63: error[invalid-key] Unknown key "year" for TypedDict `MovieExtraInt`'] +Line 255: Unexpected errors ['typeddicts_extra_items.py:255:63: error[invalid-key] Unknown key "description" for TypedDict `MovieExtraStr`'] +Line 266: Unexpected errors ['typeddicts_extra_items.py:266:64: error[invalid-key] Unknown key "year" for TypedDict `MovieExtraInt`'] +Line 284: Unexpected errors ['typeddicts_extra_items.py:284:43: error[invalid-key] Unknown key "year" for TypedDict `ExtraMovie`'] +Line 299: Unexpected errors ['typeddicts_extra_items.py:299:54: error[invalid-key] Unknown key "summary" for TypedDict `MovieExtraStr`'] Line 300: Unexpected errors ['typeddicts_extra_items.py:300:34: error[invalid-assignment] Object of type `MovieExtraStr` is not assignable to `Mapping[str, str]`'] -Line 302: Unexpected errors ['typeddicts_extra_items.py:302:54: error[invalid-key] Unknown key "year" for TypedDict `MovieExtraInt`: Unknown key "year"'] +Line 302: Unexpected errors ['typeddicts_extra_items.py:302:54: error[invalid-key] Unknown key "year" for TypedDict `MovieExtraInt`'] Line 304: Unexpected errors ['typeddicts_extra_items.py:304:44: error[invalid-assignment] Object of type `MovieExtraInt` is not assignable to `Mapping[str, int | str]`'] Line 310: Unexpected errors ['typeddicts_extra_items.py:310:5: error[type-assertion-failure] Type `list[tuple[str, object]]` does not match asserted type `list[tuple[str, int | str]]`'] Line 311: Unexpected errors ['typeddicts_extra_items.py:311:5: error[type-assertion-failure] Type `list[object]` does not match asserted type `list[int | str]`'] Line 326: Unexpected errors ['typeddicts_extra_items.py:326:25: error[invalid-assignment] Object of type `IntDict` is not assignable to `dict[str, int]`'] -Line 329: Unexpected errors ['typeddicts_extra_items.py:329:52: error[invalid-key] Unknown key "bar" for TypedDict `IntDictWithNum`: Unknown key "bar"'] +Line 329: Unexpected errors ['typeddicts_extra_items.py:329:52: error[invalid-key] Unknown key "bar" for TypedDict `IntDictWithNum`'] Line 330: Unexpected errors ['typeddicts_extra_items.py:330:32: error[invalid-assignment] Object of type `IntDictWithNum` is not assignable to `dict[str, int]`'] Line 337: Unexpected errors ['typeddicts_extra_items.py:337:1: error[unresolved-attribute] Object of type `IntDictWithNum` has no attribute `clear`'] Line 339: Unexpected errors ['typeddicts_extra_items.py:339:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `tuple[str, int]`', 'typeddicts_extra_items.py:339:13: error[unresolved-attribute] Object of type `IntDictWithNum` has no attribute `popitem`'] @@ -44,30 +44,30 @@ Line 342: Unexpected errors ['typeddicts_extra_items.py:342:27: error[invalid-ke Line 343: Unexpected errors ['typeddicts_extra_items.py:343:9: error[invalid-argument-type] Method `__delitem__` of type `(key: Literal["num"], /) -> None` cannot be called with key of type `str` on object of type `IntDictWithNum`'] """ output = """ -typeddicts_extra_items.py:14:37: error[invalid-key] Unknown key "novel_adaptation" for TypedDict `Movie`: Unknown key "novel_adaptation" -typeddicts_extra_items.py:15:37: error[invalid-key] Unknown key "year" for TypedDict `Movie`: Unknown key "year" -typeddicts_extra_items.py:29:5: error[type-assertion-failure] Type `str` does not match asserted type `bool` -typeddicts_extra_items.py:29:23: error[invalid-key] Unknown key "novel_adaptation" for TypedDict `Movie`: Unknown key "novel_adaptation" +typeddicts_extra_items.py:14:37: error[invalid-key] Unknown key "novel_adaptation" for TypedDict `Movie` +typeddicts_extra_items.py:15:37: error[invalid-key] Unknown key "year" for TypedDict `Movie` +typeddicts_extra_items.py:29:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `bool` +typeddicts_extra_items.py:29:23: error[invalid-key] Unknown key "novel_adaptation" for TypedDict `Movie` typeddicts_extra_items.py:39:54: error[invalid-argument-type] Invalid argument to key "year" with declared type `int` on TypedDict `InheritedMovie`: value of type `None` -typeddicts_extra_items.py:43:5: error[invalid-key] Unknown key "other_extra_key" for TypedDict `InheritedMovie`: Unknown key "other_extra_key" +typeddicts_extra_items.py:43:5: error[invalid-key] Unknown key "other_extra_key" for TypedDict `InheritedMovie` typeddicts_extra_items.py:128:15: error[invalid-argument-type] Cannot delete required key "name" from TypedDict `MovieEI` typeddicts_extra_items.py:129:15: error[invalid-argument-type] Cannot delete unknown key "year" from TypedDict `MovieEI` -typeddicts_extra_items.py:254:63: error[invalid-key] Unknown key "year" for TypedDict `MovieExtraInt`: Unknown key "year" -typeddicts_extra_items.py:255:63: error[invalid-key] Unknown key "description" for TypedDict `MovieExtraStr`: Unknown key "description" -typeddicts_extra_items.py:266:64: error[invalid-key] Unknown key "year" for TypedDict `MovieExtraInt`: Unknown key "year" -typeddicts_extra_items.py:278:47: error[invalid-key] Unknown key "year" for TypedDict `NonClosedMovie`: Unknown key "year" -typeddicts_extra_items.py:284:43: error[invalid-key] Unknown key "year" for TypedDict `ExtraMovie`: Unknown key "year" -typeddicts_extra_items.py:285:43: error[invalid-key] Unknown key "language" for TypedDict `ExtraMovie`: Unknown key "language" -typeddicts_extra_items.py:293:44: error[invalid-key] Unknown key "year" for TypedDict `ClosedMovie`: Unknown key "year" -typeddicts_extra_items.py:299:54: error[invalid-key] Unknown key "summary" for TypedDict `MovieExtraStr`: Unknown key "summary" +typeddicts_extra_items.py:254:63: error[invalid-key] Unknown key "year" for TypedDict `MovieExtraInt` +typeddicts_extra_items.py:255:63: error[invalid-key] Unknown key "description" for TypedDict `MovieExtraStr` +typeddicts_extra_items.py:266:64: error[invalid-key] Unknown key "year" for TypedDict `MovieExtraInt` +typeddicts_extra_items.py:278:47: error[invalid-key] Unknown key "year" for TypedDict `NonClosedMovie` +typeddicts_extra_items.py:284:43: error[invalid-key] Unknown key "year" for TypedDict `ExtraMovie` +typeddicts_extra_items.py:285:43: error[invalid-key] Unknown key "language" for TypedDict `ExtraMovie` +typeddicts_extra_items.py:293:44: error[invalid-key] Unknown key "year" for TypedDict `ClosedMovie` +typeddicts_extra_items.py:299:54: error[invalid-key] Unknown key "summary" for TypedDict `MovieExtraStr` typeddicts_extra_items.py:300:34: error[invalid-assignment] Object of type `MovieExtraStr` is not assignable to `Mapping[str, str]` -typeddicts_extra_items.py:302:54: error[invalid-key] Unknown key "year" for TypedDict `MovieExtraInt`: Unknown key "year" +typeddicts_extra_items.py:302:54: error[invalid-key] Unknown key "year" for TypedDict `MovieExtraInt` typeddicts_extra_items.py:303:34: error[invalid-assignment] Object of type `MovieExtraInt` is not assignable to `Mapping[str, int]` typeddicts_extra_items.py:304:44: error[invalid-assignment] Object of type `MovieExtraInt` is not assignable to `Mapping[str, int | str]` typeddicts_extra_items.py:310:5: error[type-assertion-failure] Type `list[tuple[str, object]]` does not match asserted type `list[tuple[str, int | str]]` typeddicts_extra_items.py:311:5: error[type-assertion-failure] Type `list[object]` does not match asserted type `list[int | str]` typeddicts_extra_items.py:326:25: error[invalid-assignment] Object of type `IntDict` is not assignable to `dict[str, int]` -typeddicts_extra_items.py:329:52: error[invalid-key] Unknown key "bar" for TypedDict `IntDictWithNum`: Unknown key "bar" +typeddicts_extra_items.py:329:52: error[invalid-key] Unknown key "bar" for TypedDict `IntDictWithNum` typeddicts_extra_items.py:330:32: error[invalid-assignment] Object of type `IntDictWithNum` is not assignable to `dict[str, int]` typeddicts_extra_items.py:337:1: error[unresolved-attribute] Object of type `IntDictWithNum` has no attribute `clear` typeddicts_extra_items.py:339:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `tuple[str, int]` diff --git a/conformance/results/ty/typeddicts_operations.toml b/conformance/results/ty/typeddicts_operations.toml index 80d83117c..8526b4218 100644 --- a/conformance/results/ty/typeddicts_operations.toml +++ b/conformance/results/ty/typeddicts_operations.toml @@ -4,11 +4,11 @@ errors_diff = """ output = """ typeddicts_operations.py:22:17: error[invalid-assignment] Invalid assignment to key "name" with declared type `str` on TypedDict `Movie`: value of type `Literal[1982]` typeddicts_operations.py:23:17: error[invalid-assignment] Invalid assignment to key "year" with declared type `int` on TypedDict `Movie`: value of type `Literal[""]` -typeddicts_operations.py:24:7: error[invalid-key] Unknown key "other" for TypedDict `Movie`: Unknown key "other" -typeddicts_operations.py:26:13: error[invalid-key] Unknown key "other" for TypedDict `Movie`: Unknown key "other" +typeddicts_operations.py:24:7: error[invalid-key] Unknown key "other" for TypedDict `Movie` +typeddicts_operations.py:26:13: error[invalid-key] Unknown key "other" for TypedDict `Movie` typeddicts_operations.py:28:9: error[missing-typed-dict-key] Missing required key 'year' in TypedDict `Movie` constructor typeddicts_operations.py:29:42: error[invalid-argument-type] Invalid argument to key "year" with declared type `int` on TypedDict `Movie`: value of type `float` -typeddicts_operations.py:32:36: error[invalid-key] Unknown key "other" for TypedDict `Movie`: Unknown key "other" +typeddicts_operations.py:32:36: error[invalid-key] Unknown key "other" for TypedDict `Movie` typeddicts_operations.py:37:20: error[missing-typed-dict-key] Missing required key 'name' in TypedDict `Movie` constructor typeddicts_operations.py:47:1: error[unresolved-attribute] Object of type `Movie` has no attribute `clear` typeddicts_operations.py:49:11: error[invalid-argument-type] Cannot delete required key "name" from TypedDict `Movie` diff --git a/conformance/results/ty/typeddicts_readonly_update.toml b/conformance/results/ty/typeddicts_readonly_update.toml index 267649f84..97c6f758c 100644 --- a/conformance/results/ty/typeddicts_readonly_update.toml +++ b/conformance/results/ty/typeddicts_readonly_update.toml @@ -1,7 +1,6 @@ -conformance_automated = "Fail" -conformant = "Unsupported" +conformance_automated = "Pass" errors_diff = """ -Line 23: Expected 1 errors """ output = """ +typeddicts_readonly_update.py:23:11: error[invalid-argument-type] Argument is incorrect: Expected ` | Iterable[tuple[str, object]]`, found `A` """ diff --git a/conformance/results/ty/typeddicts_type_consistency.toml b/conformance/results/ty/typeddicts_type_consistency.toml index 1048e6cb3..8865a0d96 100644 --- a/conformance/results/ty/typeddicts_type_consistency.toml +++ b/conformance/results/ty/typeddicts_type_consistency.toml @@ -5,7 +5,7 @@ output = """ typeddicts_type_consistency.py:21:10: error[invalid-assignment] Object of type `B1` is not assignable to `A1` typeddicts_type_consistency.py:38:10: error[invalid-assignment] Object of type `B2` is not assignable to `A2` typeddicts_type_consistency.py:65:6: error[invalid-assignment] Object of type `A3` is not assignable to `B3` -typeddicts_type_consistency.py:69:21: error[invalid-key] Unknown key "y" for TypedDict `A3`: Unknown key "y" +typeddicts_type_consistency.py:69:21: error[invalid-key] Unknown key "y" for TypedDict `A3` typeddicts_type_consistency.py:76:22: error[invalid-assignment] Object of type `B3` is not assignable to `dict[str, int]` typeddicts_type_consistency.py:77:25: error[invalid-assignment] Object of type `B3` is not assignable to `dict[str, object]` typeddicts_type_consistency.py:78:22: error[invalid-assignment] Object of type `B3` is not assignable to `dict[Any, Any]` diff --git a/conformance/results/ty/typeddicts_usage.toml b/conformance/results/ty/typeddicts_usage.toml index fe40d6182..648b7db1d 100644 --- a/conformance/results/ty/typeddicts_usage.toml +++ b/conformance/results/ty/typeddicts_usage.toml @@ -2,10 +2,10 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -typeddicts_usage.py:23:7: error[invalid-key] Unknown key "director" for TypedDict `Movie`: Unknown key "director" +typeddicts_usage.py:23:7: error[invalid-key] Unknown key "director" for TypedDict `Movie` typeddicts_usage.py:24:17: error[invalid-assignment] Invalid assignment to key "year" with declared type `int` on TypedDict `Movie`: value of type `Literal["1982"]` typeddicts_usage.py:28:17: error[missing-typed-dict-key] Missing required key 'name' in TypedDict `Movie` constructor -typeddicts_usage.py:28:18: error[invalid-key] Unknown key "title" for TypedDict `Movie`: Unknown key "title" +typeddicts_usage.py:28:18: error[invalid-key] Unknown key "title" for TypedDict `Movie` typeddicts_usage.py:35:4: error[isinstance-against-typed-dict] `TypedDict` class `Movie` cannot be used as the second argument to `isinstance`: This call will raise `TypeError` at runtime typeddicts_usage.py:40:24: error[invalid-type-form] The special form `typing.TypedDict` is not allowed in type expressions """ diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml index c01798412..fb967ae91 100644 --- a/conformance/results/ty/version.toml +++ b/conformance/results/ty/version.toml @@ -1 +1 @@ -version = "ty 0.0.22" +version = "ty 0.0.26" diff --git a/conformance/uv.lock b/conformance/uv.lock index 189f21e3d..8f1581713 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -129,26 +129,26 @@ wheels = [ [[package]] name = "ty" -version = "0.0.22" +version = "0.0.26" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f5/ee/b73c99daf598ae66a2d5d3ba6de7729d2152ab732dee7ccb8ab9446cc6d7/ty-0.0.22.tar.gz", hash = "sha256:391fc4d3a543950341b750d7f4aa94866a73e7cdbf3e9e4e4e8cfc8b7bef4f10", size = 5333861, upload-time = "2026-03-12T17:40:30.052Z" } +sdist = { url = "https://files.pythonhosted.org/packages/18/94/4879b81f8681117ccaf31544579304f6dc2ddcc0c67f872afb35869643a2/ty-0.0.26.tar.gz", hash = "sha256:0496b62405d62de7b954d6d677dc1cc5d3046197215d7a0a7fef37745d7b6d29", size = 5393643, upload-time = "2026-03-26T16:27:11.067Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/d7/f7/078f554f612723597f76cc6af70da4daed63ed721241a3f60788259c9adf/ty-0.0.22-py3-none-linux_armv6l.whl", hash = "sha256:03d37220d81016cb9d2a9c9ec11704d84f2df838f1dbf1296d91ea7fba57f8b5", size = 10328232, upload-time = "2026-03-12T17:40:19.402Z" }, - { url = "https://files.pythonhosted.org/packages/90/0b/4cfe84485d1b20bb50cdbc990f6e66b8c50cff569c7544adf0805b57ddb9/ty-0.0.22-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:3249c65b24829a312cd5cbf722ff5551ffe17b0a9781a8a372ca037d23aa1c71", size = 10148554, upload-time = "2026-03-12T17:40:25.586Z" }, - { url = "https://files.pythonhosted.org/packages/1b/7e/df31baf70d63880c9719d2cc8403b0b99c3c0d0f68f390a1109d9b231933/ty-0.0.22-py3-none-macosx_11_0_arm64.whl", hash = "sha256:470778f4335f1660f017fe2970afb7e4ce4f8b608795b19406976b8902b221a5", size = 9627910, upload-time = "2026-03-12T17:40:17.447Z" }, - { url = "https://files.pythonhosted.org/packages/99/0f/a418bcca9c87083533d6c73b65e56c6ade26b8d76a7558b3d3cc0f0eb52a/ty-0.0.22-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:75649b04b84ace92cb5c6e27013247f220f58a9a30b30eb2301992814deea0c4", size = 10155025, upload-time = "2026-03-12T17:40:21.344Z" }, - { url = "https://files.pythonhosted.org/packages/2d/3d/1974c567a58f369602065409d9109c0a81f5abbf1ae552433a89d07141a9/ty-0.0.22-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bc270f2344210cbed7d965ddeade61ffa81d93dffcdc0fded3540dccb860a9e1", size = 10133614, upload-time = "2026-03-12T17:40:23.549Z" }, - { url = "https://files.pythonhosted.org/packages/c0/c1/2da9e27c79a1fe9209589a73c989e416a7380bd77dcdf22960b3d30252bf/ty-0.0.22-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:548215b226f9726ea4d9beb77055363a8a398eb42809f042895f7a285afcb538", size = 10647101, upload-time = "2026-03-12T17:40:15.569Z" }, - { url = "https://files.pythonhosted.org/packages/c2/93/4e12c2f0ec792fd4ab9c9f70e59465d09345a453ebedb67d3bf99fd75a71/ty-0.0.22-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ed0bd1d34eba800b82ebee65269a85a9bbb2a325237e4baaf1413223f69e1899", size = 11231886, upload-time = "2026-03-12T17:40:06.875Z" }, - { url = "https://files.pythonhosted.org/packages/2a/9f/c255a078e4f2ce135497fffa4a5d3a122e4c49a00416fb78d72d7b79e119/ty-0.0.22-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dbd429a31507da9a1b0873a21215113c42cc683aa5fba96c978794485db5560a", size = 10901527, upload-time = "2026-03-12T17:40:34.429Z" }, - { url = "https://files.pythonhosted.org/packages/f2/0d/d1bdee7e16d978ea929837fb03463efc116ee8ad05d215a5efd5d80e56d3/ty-0.0.22-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c7eb85a437b3be817796e7c0f84243611de53c7d4ea102a0dca179debfe7cec0", size = 10726505, upload-time = "2026-03-12T17:40:36.342Z" }, - { url = "https://files.pythonhosted.org/packages/a5/d4/6548d2a353f794582ec94d886b310589c70316fe43476a558e53073ea911/ty-0.0.22-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b8e32e362e0666cc0769d2862a273def6b61117b8fbb9df493274d536afcd02e", size = 10128777, upload-time = "2026-03-12T17:40:38.517Z" }, - { url = "https://files.pythonhosted.org/packages/9f/d2/eb9185d3fe1fa12decb1c0a045416063bc40122187769b3dfb324da9e51c/ty-0.0.22-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:667deb1aaf802f396a626cc5a52cd55d935e8d0b46d1be068cf874f7d6f4bdb5", size = 10164992, upload-time = "2026-03-12T17:40:27.833Z" }, - { url = "https://files.pythonhosted.org/packages/7b/ec/067bb6d78cc6f5c4f55f0c3f760eb792b144697b454938fb9d10652caeb2/ty-0.0.22-py3-none-musllinux_1_2_i686.whl", hash = "sha256:e160681dbf602160e091d94a68207d1393733aedd95e3dc0b2d010bb39a70d78", size = 10342871, upload-time = "2026-03-12T17:40:13.447Z" }, - { url = "https://files.pythonhosted.org/packages/c0/04/dd3a87f54f78ceef5e6ab2add2f3bb85d45829318740f459886654b71a5d/ty-0.0.22-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:255598763079b80513d98084c4897df688e42666d7e4371349f97d258166389d", size = 10823909, upload-time = "2026-03-12T17:40:11.444Z" }, - { url = "https://files.pythonhosted.org/packages/d7/29/4b12e8ff99dec65487ec5342bd5b51fae1482e93a669d098777d55ca5eda/ty-0.0.22-py3-none-win32.whl", hash = "sha256:de0d88d9f788defddfec5507bf356bfc8b90ee301b7d6204f7609e7ac270276f", size = 9746013, upload-time = "2026-03-12T17:40:32.272Z" }, - { url = "https://files.pythonhosted.org/packages/84/16/e246795ed66ff8ee1a47497019f86ea1b4fb238bfca3068f2e08c52ef03b/ty-0.0.22-py3-none-win_amd64.whl", hash = "sha256:c216f750769ac9f3e9e61feabf3fd44c0697dce762bdcd105443d47e1a81c2b9", size = 10709350, upload-time = "2026-03-12T17:40:40.82Z" }, - { url = "https://files.pythonhosted.org/packages/3b/a4/5aafcebc4f597164381b0a82e7a8780d8f9f52df3884b16909a76282a0da/ty-0.0.22-py3-none-win_arm64.whl", hash = "sha256:49795260b9b9e3d6f04424f8ddb34907fac88c33a91b83478a74cead5dde567f", size = 10137248, upload-time = "2026-03-12T17:40:09.244Z" }, + { url = "https://files.pythonhosted.org/packages/83/24/99fe33ecd7e16d23c53b0d4244778c6d1b6eb1663b091236dcba22882d67/ty-0.0.26-py3-none-linux_armv6l.whl", hash = "sha256:35beaa56cf59725fd59ab35d8445bbd40b97fe76db39b052b1fcb31f9bf8adf7", size = 10521856, upload-time = "2026-03-26T16:27:06.335Z" }, + { url = "https://files.pythonhosted.org/packages/55/97/1b5e939e2ff69b9bb279ab680bfa8f677d886309a1ac8d9588fd6ce58146/ty-0.0.26-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:487a0be58ab0eb02e31ba71eb6953812a0f88e50633469b0c0ce3fb795fe0fa1", size = 10320958, upload-time = "2026-03-26T16:27:13.849Z" }, + { url = "https://files.pythonhosted.org/packages/71/25/37081461e13d38a190e5646948d7bc42084f7bd1c6b44f12550be3923e7e/ty-0.0.26-py3-none-macosx_11_0_arm64.whl", hash = "sha256:a01b7de5693379646d423b68f119719a1338a20017ba48a93eefaff1ee56f97b", size = 9799905, upload-time = "2026-03-26T16:26:55.805Z" }, + { url = "https://files.pythonhosted.org/packages/a1/1c/295d8f55a7b0e037dfc3a5ec4bdda3ab3cbca6f492f725bf269f96a4d841/ty-0.0.26-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:628c3ee869d113dd2bd249925662fd39d9d0305a6cb38f640ddaa7436b74a1ef", size = 10317507, upload-time = "2026-03-26T16:27:31.887Z" }, + { url = "https://files.pythonhosted.org/packages/1d/62/48b3875c5d2f48fe017468d4bbdde1164c76a8184374f1d5e6162cf7d9b8/ty-0.0.26-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:63d04f35f5370cbc91c0b9675dc83e0c53678125a7b629c9c95769e86f123e65", size = 10319821, upload-time = "2026-03-26T16:27:29.647Z" }, + { url = "https://files.pythonhosted.org/packages/ff/28/cfb2d495046d5bf42d532325cea7412fa1189912d549dbfae417a24fd794/ty-0.0.26-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a53c4e6f6a91927f8b90e584a4b12bcde05b0c1870ddff8d17462168ad7947a", size = 10831757, upload-time = "2026-03-26T16:27:37.441Z" }, + { url = "https://files.pythonhosted.org/packages/26/bf/dbc3e42f448a2d862651de070b4108028c543ca18cab096b38d7de449915/ty-0.0.26-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:caf2ced0e58d898d5e3ba5cb843e0ebd377c8a461464748586049afbd9321f51", size = 11369556, upload-time = "2026-03-26T16:26:58.655Z" }, + { url = "https://files.pythonhosted.org/packages/92/4c/6d2f8f34bc6d502ab778c9345a4a936a72ae113de11329c1764bb1f204f6/ty-0.0.26-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:384807bbcb7d7ce9b97ee5aaa6417a8ae03ccfb426c52b08018ca62cf60f5430", size = 11085679, upload-time = "2026-03-26T16:27:21.746Z" }, + { url = "https://files.pythonhosted.org/packages/cc/f4/f3f61c203bc980dd9bba0ba7ed3c6e81ddfd36b286330f9487c2c7d041aa/ty-0.0.26-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a2c766a94d79b4f82995d41229702caf2d76e5c440ec7e543d05c70e98bf8ab", size = 10900581, upload-time = "2026-03-26T16:27:24.39Z" }, + { url = "https://files.pythonhosted.org/packages/3d/fd/3ca1b4e4bdd129829e9ce78677e0f8e0f1038a7702dccecfa52f037c6046/ty-0.0.26-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f41ac45a0f8e3e8e181508d863a0a62156341db0f624ffd004b97ee550a9de80", size = 10294401, upload-time = "2026-03-26T16:27:03.999Z" }, + { url = "https://files.pythonhosted.org/packages/de/20/4ee3d8c3f90e008843795c765cb8bb245f188c23e5e5cc612c7697406fba/ty-0.0.26-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:73eb8327a34d529438dfe4db46796946c4e825167cbee434dc148569892e435f", size = 10351469, upload-time = "2026-03-26T16:27:19.003Z" }, + { url = "https://files.pythonhosted.org/packages/3d/b1/9fb154ade65906d4148f0b999c4a8257c2a34253cb72e15d84c1f04a064e/ty-0.0.26-py3-none-musllinux_1_2_i686.whl", hash = "sha256:4bb53a79259516535a1b55f613ba1619e9c666854946474ca8418c35a5c4fd60", size = 10529488, upload-time = "2026-03-26T16:27:01.378Z" }, + { url = "https://files.pythonhosted.org/packages/a5/70/9b02b03b1862e27b64143db65946d68b138160a5b6bfea193bee0b8bbc34/ty-0.0.26-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:2f0e75edc1aeb1b4b84af516c7891f631254a4ca3dcd15e848fa1e061e1fe9da", size = 10999015, upload-time = "2026-03-26T16:27:34.636Z" }, + { url = "https://files.pythonhosted.org/packages/21/16/0a56b8667296e2989b9d48095472d98ebf57a0006c71f2a101bbc62a142d/ty-0.0.26-py3-none-win32.whl", hash = "sha256:943c998c5523ed6b519c899c0c39b26b4c751a9759e460fb964765a44cde226f", size = 9912378, upload-time = "2026-03-26T16:27:08.999Z" }, + { url = "https://files.pythonhosted.org/packages/60/c2/fef0d4bba9cd89a82d725b3b1a66efb1b36629ecf0fb1d8e916cb75b8829/ty-0.0.26-py3-none-win_amd64.whl", hash = "sha256:19c856d343efeb1ecad8ee220848f5d2c424daf7b2feda357763ad3036e2172f", size = 10863737, upload-time = "2026-03-26T16:27:27.06Z" }, + { url = "https://files.pythonhosted.org/packages/4d/05/888ebcb3c4d3b6b72d5d3241fddd299142caa3c516e6d26a9cd887dfed3b/ty-0.0.26-py3-none-win_arm64.whl", hash = "sha256:2cde58ccffa046db1223dc28f3e7d4f2c7da8267e97cc5cd186af6fe85f1758a", size = 10285408, upload-time = "2026-03-26T16:27:16.432Z" }, ] [[package]] From 874ca55349b4e1c40a4b363b0c3eca43e40a0406 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 26 Mar 2026 17:28:16 +0000 Subject: [PATCH 2/2] address review --- conformance/results/results.html | 2 +- .../results/ty/dataclasses_transform_converter.toml | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index be7ffd26d..2c21be322 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -895,7 +895,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -
Pass*

Does not pass all assertions in the test file, due to limitations in ty's generics solver.

Incorrectly rejects a converter of `dict` combined with a default of `()`.

Incorrectly rejects passing a sequence of two-element string tuples to the `dict` constructor.

+
Partial

Does not pass all assertions in the test file, due to limitations in ty's generics solver.

Incorrectly rejects a converter of `dict` combined with a default of `()`.

Incorrectly rejects passing a sequence of two-element string tuples to the `dict` constructor.

     dataclasses_transform_field
Partial

Does not properly handle field constructor that has default value for `kw_only` or `init` parameter.

diff --git a/conformance/results/ty/dataclasses_transform_converter.toml b/conformance/results/ty/dataclasses_transform_converter.toml index 87c98dfd5..d6012d039 100644 --- a/conformance/results/ty/dataclasses_transform_converter.toml +++ b/conformance/results/ty/dataclasses_transform_converter.toml @@ -1,17 +1,14 @@ -conformance_automated = "Pass" -conformant = "Pass" +conformance_automated = "Fail" +conformant = "Partial" notes = """ Does not pass all assertions in the test file, due to limitations in ty's generics solver. Incorrectly rejects a converter of `dict` combined with a default of `()`. Incorrectly rejects passing a sequence of two-element string tuples to the `dict` constructor. """ -ignore_errors = [ - "Object of type `dict[str, str] | dict[bytes, bytes]` is not assignable to `dict[str, str]`", - "Argument to function `model_field` is incorrect: Expected `(Iterable[list[str]] | Iterable[list[bytes]], /) -> dict[str, str] | dict[bytes, bytes]`, found ``", - "Argument is incorrect: Expected `dict[str, str]`, found `tuple[tuple[Literal[\"a\"], Literal[\"1\"]], tuple[Literal[\"b\"], Literal[\"2\"]]]`", -] errors_diff = """ +Line 104: Unexpected errors ['dataclasses_transform_converter.py:104:30: error[invalid-assignment] Object of type `dict[str, str] | dict[bytes, bytes]` is not assignable to `dict[str, str]`', "dataclasses_transform_converter.py:104:42: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(Iterable[list[str]] | Iterable[list[bytes]], /) -> dict[str, str] | dict[bytes, bytes]`, found ``"] +Line 121: Unexpected errors ['dataclasses_transform_converter.py:121:40: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, str]`, found `tuple[tuple[Literal["a"], Literal["1"]], tuple[Literal["b"], Literal["2"]]]`'] """ output = """ dataclasses_transform_converter.py:48:31: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(Unknown, /) -> Unknown`, found `def bad_converter1() -> int`